/**
 *
 */
import OpenApi;
import OpenApi.OpenApiUtil;

extends OpenApi;


init(config: OpenApiUtil.Config){
  super(config);
  @endpointRule = 'regional';
  @endpointMap = {
    'ap-northeast-1' = 'polardbx.aliyuncs.com',
    'ap-northeast-2-pop' = 'polardbx.aliyuncs.com',
    'ap-south-1' = 'polardbx.aliyuncs.com',
    'ap-southeast-2' = 'polardbx.aliyuncs.com',
    'ap-southeast-3' = 'polardbx.aliyuncs.com',
    'ap-southeast-5' = 'polardbx.aliyuncs.com',
    'cn-beijing-finance-1' = 'polardbx.aliyuncs.com',
    'cn-beijing-finance-pop' = 'polardbx.aliyuncs.com',
    'cn-beijing-gov-1' = 'polardbx.aliyuncs.com',
    'cn-beijing-nu16-b01' = 'polardbx.aliyuncs.com',
    'cn-edge-1' = 'polardbx.aliyuncs.com',
    'cn-fujian' = 'polardbx.aliyuncs.com',
    'cn-haidian-cm12-c01' = 'polardbx.aliyuncs.com',
    'cn-hangzhou-bj-b01' = 'polardbx.aliyuncs.com',
    'cn-hangzhou-finance' = 'polardbx.aliyuncs.com',
    'cn-hangzhou-internal-prod-1' = 'polardbx.aliyuncs.com',
    'cn-hangzhou-internal-test-1' = 'polardbx.aliyuncs.com',
    'cn-hangzhou-internal-test-2' = 'polardbx.aliyuncs.com',
    'cn-hangzhou-internal-test-3' = 'polardbx.aliyuncs.com',
    'cn-hangzhou-test-306' = 'polardbx.aliyuncs.com',
    'cn-hongkong-finance-pop' = 'polardbx.aliyuncs.com',
    'cn-huhehaote-nebula-1' = 'polardbx.aliyuncs.com',
    'cn-north-2-gov-1' = 'polardbx.aliyuncs.com',
    'cn-qingdao-nebula' = 'polardbx.aliyuncs.com',
    'cn-shanghai-et15-b01' = 'polardbx.aliyuncs.com',
    'cn-shanghai-et2-b01' = 'polardbx.aliyuncs.com',
    'cn-shanghai-finance-1' = 'polardbx.aliyuncs.com',
    'cn-shanghai-inner' = 'polardbx.aliyuncs.com',
    'cn-shanghai-internal-test-1' = 'polardbx.aliyuncs.com',
    'cn-shenzhen-finance-1' = 'polardbx.aliyuncs.com',
    'cn-shenzhen-inner' = 'polardbx.aliyuncs.com',
    'cn-shenzhen-st4-d01' = 'polardbx.aliyuncs.com',
    'cn-shenzhen-su18-b01' = 'polardbx.aliyuncs.com',
    'cn-wuhan' = 'polardbx.aliyuncs.com',
    'cn-wulanchabu' = 'polardbx.aliyuncs.com',
    'cn-yushanfang' = 'polardbx.aliyuncs.com',
    'cn-zhangbei' = 'polardbx.aliyuncs.com',
    'cn-zhangbei-na61-b01' = 'polardbx.aliyuncs.com',
    'cn-zhangjiakou-na62-a01' = 'polardbx.aliyuncs.com',
    'cn-zhengzhou-nebula-1' = 'polardbx.aliyuncs.com',
    'eu-central-1' = 'polardbx.aliyuncs.com',
    'eu-west-1' = 'polardbx.aliyuncs.com',
    'eu-west-1-oxs' = 'polardbx.aliyuncs.com',
    'me-east-1' = 'polardbx.aliyuncs.com',
    'rus-west-1-pop' = 'polardbx.aliyuncs.com',
  };

  checkConfig(config);
  @endpoint = getEndpoint('polardbx', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!$isNull(endpoint)) {
    return endpoint;
  }
  
  if (!$isNull(endpointMap) && !$isNull(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return OpenApiUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model AlignStoragePrimaryAzoneRequest {
  DBInstanceName?: string(name='DBInstanceName', description='This parameter is required.'),
  regionId?: string(name='RegionId', description='This parameter is required.'),
  storageInstanceName?: string(name='StorageInstanceName'),
  switchTime?: string(name='SwitchTime'),
  switchTimeMode?: string(name='SwitchTimeMode'),
}

model AlignStoragePrimaryAzoneResponseBody = {
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model AlignStoragePrimaryAzoneResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AlignStoragePrimaryAzoneResponseBody(name='body'),
}

/**
 * @param request AlignStoragePrimaryAzoneRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AlignStoragePrimaryAzoneResponse
 */
async function alignStoragePrimaryAzoneWithOptions(request: AlignStoragePrimaryAzoneRequest, runtime: $RuntimeOptions): AlignStoragePrimaryAzoneResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.DBInstanceName)) {
    query['DBInstanceName'] = request.DBInstanceName;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.storageInstanceName)) {
    query['StorageInstanceName'] = request.storageInstanceName;
  }
  if (!$isNull(request.switchTime)) {
    query['SwitchTime'] = request.switchTime;
  }
  if (!$isNull(request.switchTimeMode)) {
    query['SwitchTimeMode'] = request.switchTimeMode;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'AlignStoragePrimaryAzone',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request AlignStoragePrimaryAzoneRequest
 * @return AlignStoragePrimaryAzoneResponse
 */
async function alignStoragePrimaryAzone(request: AlignStoragePrimaryAzoneRequest): AlignStoragePrimaryAzoneResponse {
  var runtime = new $RuntimeOptions{};
  return alignStoragePrimaryAzoneWithOptions(request, runtime);
}

model AllocateColdDataVolumeRequest {
  DBInstanceName?: string(name='DBInstanceName', description='This parameter is required.', example='pxc-hzravgpt8q****'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
}

model AllocateColdDataVolumeResponseBody = {
  requestId?: string(name='RequestId', example='D6A4256F-7B83-5BD7-9AC0-72E1FAC05330'),
}

model AllocateColdDataVolumeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AllocateColdDataVolumeResponseBody(name='body'),
}

/**
 * @summary 开通冷存储
 *
 * @param request AllocateColdDataVolumeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AllocateColdDataVolumeResponse
 */
async function allocateColdDataVolumeWithOptions(request: AllocateColdDataVolumeRequest, runtime: $RuntimeOptions): AllocateColdDataVolumeResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.DBInstanceName)) {
    query['DBInstanceName'] = request.DBInstanceName;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'AllocateColdDataVolume',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 开通冷存储
 *
 * @param request AllocateColdDataVolumeRequest
 * @return AllocateColdDataVolumeResponse
 */
async function allocateColdDataVolume(request: AllocateColdDataVolumeRequest): AllocateColdDataVolumeResponse {
  var runtime = new $RuntimeOptions{};
  return allocateColdDataVolumeWithOptions(request, runtime);
}

model AllocateInstancePublicConnectionRequest {
  connectionStringPrefix?: string(name='ConnectionStringPrefix', description='This parameter is required.', example='pxc-**************'),
  DBInstanceName?: string(name='DBInstanceName', description='This parameter is required.', example='pxc-**************'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  port?: string(name='Port', description='This parameter is required.', example='3306'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model AllocateInstancePublicConnectionResponseBody = {
  requestId?: string(name='RequestId', example='9B2F3840-5C98-475C-B269-2D5C3A31797C'),
}

model AllocateInstancePublicConnectionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AllocateInstancePublicConnectionResponseBody(name='body'),
}

/**
 * @param request AllocateInstancePublicConnectionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AllocateInstancePublicConnectionResponse
 */
async function allocateInstancePublicConnectionWithOptions(request: AllocateInstancePublicConnectionRequest, runtime: $RuntimeOptions): AllocateInstancePublicConnectionResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.connectionStringPrefix)) {
    query['ConnectionStringPrefix'] = request.connectionStringPrefix;
  }
  if (!$isNull(request.DBInstanceName)) {
    query['DBInstanceName'] = request.DBInstanceName;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.port)) {
    query['Port'] = request.port;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'AllocateInstancePublicConnection',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request AllocateInstancePublicConnectionRequest
 * @return AllocateInstancePublicConnectionResponse
 */
async function allocateInstancePublicConnection(request: AllocateInstancePublicConnectionRequest): AllocateInstancePublicConnectionResponse {
  var runtime = new $RuntimeOptions{};
  return allocateInstancePublicConnectionWithOptions(request, runtime);
}

model CancelActiveOperationTasksRequest {
  ids?: string(name='Ids', description='This parameter is required.', example='111'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
}

model CancelActiveOperationTasksResponseBody = {
  ids?: string(name='Ids', example='111,1223'),
  requestId?: string(name='RequestId', example='AE4F6C34-065F-45AA-B5DC-4B8D816F6305'),
}

model CancelActiveOperationTasksResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CancelActiveOperationTasksResponseBody(name='body'),
}

/**
 * @summary 取消主动运维任务
 *
 * @param request CancelActiveOperationTasksRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CancelActiveOperationTasksResponse
 */
async function cancelActiveOperationTasksWithOptions(request: CancelActiveOperationTasksRequest, runtime: $RuntimeOptions): CancelActiveOperationTasksResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CancelActiveOperationTasks',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 取消主动运维任务
 *
 * @param request CancelActiveOperationTasksRequest
 * @return CancelActiveOperationTasksResponse
 */
async function cancelActiveOperationTasks(request: CancelActiveOperationTasksRequest): CancelActiveOperationTasksResponse {
  var runtime = new $RuntimeOptions{};
  return cancelActiveOperationTasksWithOptions(request, runtime);
}

model ChangeResourceGroupRequest {
  newResourceGroupId?: string(name='NewResourceGroupId', description='This parameter is required.', example='rg-acfmwolx3j4****'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  resourceId?: string(name='ResourceId', description='This parameter is required.', example='pxc-szrwrbp693****'),
  resourceType?: string(name='ResourceType', description='This parameter is required.', example='PolarDBXInstance'),
}

model ChangeResourceGroupResponseBody = {
  requestId?: string(name='RequestId', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3WE34'),
}

model ChangeResourceGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ChangeResourceGroupResponseBody(name='body'),
}

/**
 * @summary 修改实例所在资源组.
 *
 * @param request ChangeResourceGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ChangeResourceGroupResponse
 */
async function changeResourceGroupWithOptions(request: ChangeResourceGroupRequest, runtime: $RuntimeOptions): ChangeResourceGroupResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.newResourceGroupId)) {
    query['NewResourceGroupId'] = request.newResourceGroupId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!$isNull(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ChangeResourceGroup',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 修改实例所在资源组.
 *
 * @param request ChangeResourceGroupRequest
 * @return ChangeResourceGroupResponse
 */
async function changeResourceGroup(request: ChangeResourceGroupRequest): ChangeResourceGroupResponse {
  var runtime = new $RuntimeOptions{};
  return changeResourceGroupWithOptions(request, runtime);
}

model CheckCloudResourceAuthorizedRequest {
  DBInstanceName?: string(name='DBInstanceName', description='This parameter is required.', example='pxc-********'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  roleArn?: string(name='RoleArn', example='acs:ram::123456789012****:role/AliyunRdsInstanceEncryptionDefaultRole'),
}

model CheckCloudResourceAuthorizedResponseBody = {
  data?: {
    authorizationState?: string(name='AuthorizationState', example='0'),
    roleArn?: string(name='RoleArn', example='acs:ram::123456789012****:role/AliyunRdsInstanceEncryptionDefaultRole'),
  }(name='Data'),
  requestId?: string(name='RequestId', example='A501A191-BD70-5E50-98A9-C2A486A82****'),
}

model CheckCloudResourceAuthorizedResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CheckCloudResourceAuthorizedResponseBody(name='body'),
}

/**
 * @param request CheckCloudResourceAuthorizedRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CheckCloudResourceAuthorizedResponse
 */
async function checkCloudResourceAuthorizedWithOptions(request: CheckCloudResourceAuthorizedRequest, runtime: $RuntimeOptions): CheckCloudResourceAuthorizedResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.DBInstanceName)) {
    query['DBInstanceName'] = request.DBInstanceName;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.roleArn)) {
    query['RoleArn'] = request.roleArn;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CheckCloudResourceAuthorized',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request CheckCloudResourceAuthorizedRequest
 * @return CheckCloudResourceAuthorizedResponse
 */
async function checkCloudResourceAuthorized(request: CheckCloudResourceAuthorizedRequest): CheckCloudResourceAuthorizedResponse {
  var runtime = new $RuntimeOptions{};
  return checkCloudResourceAuthorizedWithOptions(request, runtime);
}

model CreateAccountRequest {
  accountDescription?: string(name='AccountDescription', example='test'),
  accountName?: string(name='AccountName', description='This parameter is required.', example='testAccount'),
  accountPassword?: string(name='AccountPassword', description='This parameter is required.', example='Test@1111'),
  accountPrivilege?: string(name='AccountPrivilege', example='ReadWrite'),
  DBInstanceName?: string(name='DBInstanceName', description='This parameter is required.', example='pxc-**************'),
  DBName?: string(name='DBName', example='testdb'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  securityAccountName?: string(name='SecurityAccountName', example='securityAccount'),
  securityAccountPassword?: string(name='SecurityAccountPassword', example='securityPassword'),
}

model CreateAccountResponseBody = {
  message?: string(name='Message', example='****'),
  requestId?: string(name='RequestId', example='9B2F3840-5C98-475C-B269-2D5C3A31797C'),
  success?: boolean(name='Success', example='true'),
}

model CreateAccountResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateAccountResponseBody(name='body'),
}

/**
 * @param request CreateAccountRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateAccountResponse
 */
async function createAccountWithOptions(request: CreateAccountRequest, runtime: $RuntimeOptions): CreateAccountResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.accountDescription)) {
    query['AccountDescription'] = request.accountDescription;
  }
  if (!$isNull(request.accountName)) {
    query['AccountName'] = request.accountName;
  }
  if (!$isNull(request.accountPassword)) {
    query['AccountPassword'] = request.accountPassword;
  }
  if (!$isNull(request.accountPrivilege)) {
    query['AccountPrivilege'] = request.accountPrivilege;
  }
  if (!$isNull(request.DBInstanceName)) {
    query['DBInstanceName'] = request.DBInstanceName;
  }
  if (!$isNull(request.DBName)) {
    query['DBName'] = request.DBName;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.securityAccountName)) {
    query['SecurityAccountName'] = request.securityAccountName;
  }
  if (!$isNull(request.securityAccountPassword)) {
    query['SecurityAccountPassword'] = request.securityAccountPassword;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateAccount',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request CreateAccountRequest
 * @return CreateAccountResponse
 */
async function createAccount(request: CreateAccountRequest): CreateAccountResponse {
  var runtime = new $RuntimeOptions{};
  return createAccountWithOptions(request, runtime);
}

model CreateBackupRequest {
  backupType?: string(name='BackupType', example='0'),
  DBInstanceName?: string(name='DBInstanceName', description='This parameter is required.', example='pxc-**************'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
}

model CreateBackupResponseBody = {
  data?: {
    backupSetId?: string(name='BackupSetId'),
  }(name='Data'),
  message?: string(name='Message', example='*****'),
  requestId?: string(name='RequestId', example='9B2F3840-5C98-475C-B269-2D5C3A31797C'),
  success?: boolean(name='Success', example='true'),
}

model CreateBackupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateBackupResponseBody(name='body'),
}

/**
 * @param request CreateBackupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateBackupResponse
 */
async function createBackupWithOptions(request: CreateBackupRequest, runtime: $RuntimeOptions): CreateBackupResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.backupType)) {
    query['BackupType'] = request.backupType;
  }
  if (!$isNull(request.DBInstanceName)) {
    query['DBInstanceName'] = request.DBInstanceName;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateBackup',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request CreateBackupRequest
 * @return CreateBackupResponse
 */
async function createBackup(request: CreateBackupRequest): CreateBackupResponse {
  var runtime = new $RuntimeOptions{};
  return createBackupWithOptions(request, runtime);
}

model CreateDBRequest {
  accountName?: string(name='AccountName', description='This parameter is required.', example='testaccount'),
  accountPrivilege?: string(name='AccountPrivilege', example='ReadWrite'),
  charset?: string(name='Charset', description='This parameter is required.', example='utf8mb4'),
  DBInstanceName?: string(name='DBInstanceName', description='This parameter is required.', example='pxc-**************'),
  dbDescription?: string(name='DbDescription', example='db for test'),
  dbName?: string(name='DbName', description='This parameter is required.', example='testdb'),
  mode?: string(name='Mode', example='auto'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  securityAccountName?: string(name='SecurityAccountName', example='securityAccount'),
  securityAccountPassword?: string(name='SecurityAccountPassword', example='securityPassword'),
  storagePoolName?: string(name='StoragePoolName'),
}

model CreateDBResponseBody = {
  message?: string(name='Message', example='*****'),
  requestId?: string(name='RequestId', example='9B2F3840-5C98-475C-B269-2D5C3A31797C'),
  success?: boolean(name='Success', example='true'),
}

model CreateDBResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateDBResponseBody(name='body'),
}

/**
 * @param request CreateDBRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateDBResponse
 */
async function createDBWithOptions(request: CreateDBRequest, runtime: $RuntimeOptions): CreateDBResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.accountName)) {
    query['AccountName'] = request.accountName;
  }
  if (!$isNull(request.accountPrivilege)) {
    query['AccountPrivilege'] = request.accountPrivilege;
  }
  if (!$isNull(request.charset)) {
    query['Charset'] = request.charset;
  }
  if (!$isNull(request.DBInstanceName)) {
    query['DBInstanceName'] = request.DBInstanceName;
  }
  if (!$isNull(request.dbDescription)) {
    query['DbDescription'] = request.dbDescription;
  }
  if (!$isNull(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!$isNull(request.mode)) {
    query['Mode'] = request.mode;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.securityAccountName)) {
    query['SecurityAccountName'] = request.securityAccountName;
  }
  if (!$isNull(request.securityAccountPassword)) {
    query['SecurityAccountPassword'] = request.securityAccountPassword;
  }
  if (!$isNull(request.storagePoolName)) {
    query['StoragePoolName'] = request.storagePoolName;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateDB',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request CreateDBRequest
 * @return CreateDBResponse
 */
async function createDB(request: CreateDBRequest): CreateDBResponse {
  var runtime = new $RuntimeOptions{};
  return createDBWithOptions(request, runtime);
}

model CreateDBInstanceRequest {
  autoRenew?: boolean(name='AutoRenew', example='true'),
  CNNodeCount?: int32(name='CNNodeCount'),
  clientToken?: string(name='ClientToken', example='xxxxxx-xxx'),
  cnClass?: string(name='CnClass'),
  DBNodeClass?: string(name='DBNodeClass', example='polarx.x4.2xlarge.2d'),
  DBNodeCount?: int32(name='DBNodeCount', example='2'),
  DNNodeCount?: int32(name='DNNodeCount'),
  dnClass?: string(name='DnClass'),
  dnStorageSpace?: string(name='DnStorageSpace'),
  engineVersion?: string(name='EngineVersion', description='This parameter is required.', example='2.0'),
  extraParams?: map[string]string(name='ExtraParams'),
  isColumnarReadDBInstance?: boolean(name='IsColumnarReadDBInstance'),
  isReadDBInstance?: boolean(name='IsReadDBInstance', example='false'),
  networkType?: string(name='NetworkType', example='vpc'),
  payType?: string(name='PayType', description='This parameter is required.', example='PREPAY'),
  period?: string(name='Period', example='Month'),
  primaryDBInstanceName?: string(name='PrimaryDBInstanceName', example='pxc-*********'),
  primaryZone?: string(name='PrimaryZone', example='cn-shenzhen-e'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', example='null'),
  secondaryZone?: string(name='SecondaryZone', example='cn-shenzhen-a'),
  series?: string(name='Series'),
  tertiaryZone?: string(name='TertiaryZone', example='cn-shenzhen-e'),
  topologyType?: string(name='TopologyType', description='This parameter is required.', example='3azones'),
  usedTime?: int32(name='UsedTime', example='1'),
  VPCId?: string(name='VPCId', description='VPC ID。', example='vpc-*****'),
  vSwitchId?: string(name='VSwitchId', example='vsw-*********'),
  zoneId?: string(name='ZoneId', example='cn-hangzhou-a'),
}

model CreateDBInstanceShrinkRequest {
  autoRenew?: boolean(name='AutoRenew', example='true'),
  CNNodeCount?: int32(name='CNNodeCount'),
  clientToken?: string(name='ClientToken', example='xxxxxx-xxx'),
  cnClass?: string(name='CnClass'),
  DBNodeClass?: string(name='DBNodeClass', example='polarx.x4.2xlarge.2d'),
  DBNodeCount?: int32(name='DBNodeCount', example='2'),
  DNNodeCount?: int32(name='DNNodeCount'),
  dnClass?: string(name='DnClass'),
  dnStorageSpace?: string(name='DnStorageSpace'),
  engineVersion?: string(name='EngineVersion', description='This parameter is required.', example='2.0'),
  extraParamsShrink?: string(name='ExtraParams'),
  isColumnarReadDBInstance?: boolean(name='IsColumnarReadDBInstance'),
  isReadDBInstance?: boolean(name='IsReadDBInstance', example='false'),
  networkType?: string(name='NetworkType', example='vpc'),
  payType?: string(name='PayType', description='This parameter is required.', example='PREPAY'),
  period?: string(name='Period', example='Month'),
  primaryDBInstanceName?: string(name='PrimaryDBInstanceName', example='pxc-*********'),
  primaryZone?: string(name='PrimaryZone', example='cn-shenzhen-e'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', example='null'),
  secondaryZone?: string(name='SecondaryZone', example='cn-shenzhen-a'),
  series?: string(name='Series'),
  tertiaryZone?: string(name='TertiaryZone', example='cn-shenzhen-e'),
  topologyType?: string(name='TopologyType', description='This parameter is required.', example='3azones'),
  usedTime?: int32(name='UsedTime', example='1'),
  VPCId?: string(name='VPCId', description='VPC ID。', example='vpc-*****'),
  vSwitchId?: string(name='VSwitchId', example='vsw-*********'),
  zoneId?: string(name='ZoneId', example='cn-hangzhou-a'),
}

model CreateDBInstanceResponseBody = {
  DBInstanceName?: string(name='DBInstanceName', example='pxc-*********'),
  orderId?: string(name='OrderId', example='12345'),
  requestId?: string(name='RequestId', example='9B2F3840-5C98-475C-B269-2D5C3A31797C'),
}

model CreateDBInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateDBInstanceResponseBody(name='body'),
}

/**
 * @summary 创建实例
 *
 * @param tmpReq CreateDBInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateDBInstanceResponse
 */
async function createDBInstanceWithOptions(tmpReq: CreateDBInstanceRequest, runtime: $RuntimeOptions): CreateDBInstanceResponse {
  tmpReq.validate();
  var request = new CreateDBInstanceShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.extraParams)) {
    request.extraParamsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.extraParams, 'ExtraParams', 'json');
  }
  var query = {};
  if (!$isNull(request.autoRenew)) {
    query['AutoRenew'] = request.autoRenew;
  }
  if (!$isNull(request.CNNodeCount)) {
    query['CNNodeCount'] = request.CNNodeCount;
  }
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.cnClass)) {
    query['CnClass'] = request.cnClass;
  }
  if (!$isNull(request.DBNodeClass)) {
    query['DBNodeClass'] = request.DBNodeClass;
  }
  if (!$isNull(request.DBNodeCount)) {
    query['DBNodeCount'] = request.DBNodeCount;
  }
  if (!$isNull(request.DNNodeCount)) {
    query['DNNodeCount'] = request.DNNodeCount;
  }
  if (!$isNull(request.dnClass)) {
    query['DnClass'] = request.dnClass;
  }
  if (!$isNull(request.dnStorageSpace)) {
    query['DnStorageSpace'] = request.dnStorageSpace;
  }
  if (!$isNull(request.engineVersion)) {
    query['EngineVersion'] = request.engineVersion;
  }
  if (!$isNull(request.extraParamsShrink)) {
    query['ExtraParams'] = request.extraParamsShrink;
  }
  if (!$isNull(request.isColumnarReadDBInstance)) {
    query['IsColumnarReadDBInstance'] = request.isColumnarReadDBInstance;
  }
  if (!$isNull(request.isReadDBInstance)) {
    query['IsReadDBInstance'] = request.isReadDBInstance;
  }
  if (!$isNull(request.networkType)) {
    query['NetworkType'] = request.networkType;
  }
  if (!$isNull(request.payType)) {
    query['PayType'] = request.payType;
  }
  if (!$isNull(request.period)) {
    query['Period'] = request.period;
  }
  if (!$isNull(request.primaryDBInstanceName)) {
    query['PrimaryDBInstanceName'] = request.primaryDBInstanceName;
  }
  if (!$isNull(request.primaryZone)) {
    query['PrimaryZone'] = request.primaryZone;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!$isNull(request.secondaryZone)) {
    query['SecondaryZone'] = request.secondaryZone;
  }
  if (!$isNull(request.series)) {
    query['Series'] = request.series;
  }
  if (!$isNull(request.tertiaryZone)) {
    query['TertiaryZone'] = request.tertiaryZone;
  }
  if (!$isNull(request.topologyType)) {
    query['TopologyType'] = request.topologyType;
  }
  if (!$isNull(request.usedTime)) {
    query['UsedTime'] = request.usedTime;
  }
  if (!$isNull(request.VPCId)) {
    query['VPCId'] = request.VPCId;
  }
  if (!$isNull(request.vSwitchId)) {
    query['VSwitchId'] = request.vSwitchId;
  }
  if (!$isNull(request.zoneId)) {
    query['ZoneId'] = request.zoneId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateDBInstance',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建实例
 *
 * @param request CreateDBInstanceRequest
 * @return CreateDBInstanceResponse
 */
async function createDBInstance(request: CreateDBInstanceRequest): CreateDBInstanceResponse {
  var runtime = new $RuntimeOptions{};
  return createDBInstanceWithOptions(request, runtime);
}

model CreateSuperAccountRequest {
  accountDescription?: string(name='AccountDescription', example='testdbadescription'),
  accountName?: string(name='AccountName', description='This parameter is required.', example='dba'),
  accountPassword?: string(name='AccountPassword', description='This parameter is required.', example='testdbapassword'),
  DBInstanceName?: string(name='DBInstanceName', description='This parameter is required.', example='pxc-************'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
}

model CreateSuperAccountResponseBody = {
  message?: string(name='Message', example='*****'),
  requestId?: string(name='RequestId', example='9B2F3840-5C98-475C-B269-2D5C3A31797C'),
  success?: boolean(name='Success', example='true'),
}

model CreateSuperAccountResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateSuperAccountResponseBody(name='body'),
}

/**
 * @param request CreateSuperAccountRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateSuperAccountResponse
 */
async function createSuperAccountWithOptions(request: CreateSuperAccountRequest, runtime: $RuntimeOptions): CreateSuperAccountResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.accountDescription)) {
    query['AccountDescription'] = request.accountDescription;
  }
  if (!$isNull(request.accountName)) {
    query['AccountName'] = request.accountName;
  }
  if (!$isNull(request.accountPassword)) {
    query['AccountPassword'] = request.accountPassword;
  }
  if (!$isNull(request.DBInstanceName)) {
    query['DBInstanceName'] = request.DBInstanceName;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateSuperAccount',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request CreateSuperAccountRequest
 * @return CreateSuperAccountResponse
 */
async function createSuperAccount(request: CreateSuperAccountRequest): CreateSuperAccountResponse {
  var runtime = new $RuntimeOptions{};
  return createSuperAccountWithOptions(request, runtime);
}

model DeleteAccountRequest {
  accountName?: string(name='AccountName', description='This parameter is required.', example='testaccount'),
  DBInstanceName?: string(name='DBInstanceName', description='This parameter is required.', example='pxc-*********'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  securityAccountName?: string(name='SecurityAccountName', example='securityAccount'),
  securityAccountPassword?: string(name='SecurityAccountPassword', example='securityPassword'),
}

model DeleteAccountResponseBody = {
  message?: string(name='Message', example='****'),
  requestId?: string(name='RequestId', example='9B2F3840-5C98-475C-B269-2D5C3A31797C'),
  success?: boolean(name='Success', example='true'),
}

model DeleteAccountResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteAccountResponseBody(name='body'),
}

/**
 * @param request DeleteAccountRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteAccountResponse
 */
async function deleteAccountWithOptions(request: DeleteAccountRequest, runtime: $RuntimeOptions): DeleteAccountResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.accountName)) {
    query['AccountName'] = request.accountName;
  }
  if (!$isNull(request.DBInstanceName)) {
    query['DBInstanceName'] = request.DBInstanceName;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.securityAccountName)) {
    query['SecurityAccountName'] = request.securityAccountName;
  }
  if (!$isNull(request.securityAccountPassword)) {
    query['SecurityAccountPassword'] = request.securityAccountPassword;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteAccount',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DeleteAccountRequest
 * @return DeleteAccountResponse
 */
async function deleteAccount(request: DeleteAccountRequest): DeleteAccountResponse {
  var runtime = new $RuntimeOptions{};
  return deleteAccountWithOptions(request, runtime);
}

model DeleteDBRequest {
  DBInstanceName?: string(name='DBInstanceName', description='This parameter is required.', example='pxc-********'),
  dbName?: string(name='DbName', description='This parameter is required.', example='testdb'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
}

model DeleteDBResponseBody = {
  message?: string(name='Message', example='*****'),
  requestId?: string(name='RequestId', example='9B2F3840-5C98-475C-B269-2D5C3A31797C'),
  success?: boolean(name='Success', example='true'),
}

model DeleteDBResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteDBResponseBody(name='body'),
}

/**
 * @param request DeleteDBRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteDBResponse
 */
async function deleteDBWithOptions(request: DeleteDBRequest, runtime: $RuntimeOptions): DeleteDBResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.DBInstanceName)) {
    query['DBInstanceName'] = request.DBInstanceName;
  }
  if (!$isNull(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteDB',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DeleteDBRequest
 * @return DeleteDBResponse
 */
async function deleteDB(request: DeleteDBRequest): DeleteDBResponse {
  var runtime = new $RuntimeOptions{};
  return deleteDBWithOptions(request, runtime);
}

model DeleteDBInstanceRequest {
  DBInstanceName?: string(name='DBInstanceName', description='This parameter is required.', example='pxc-********'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
}

model DeleteDBInstanceResponseBody = {
  requestId?: string(name='RequestId', example='9B2F3840-5C98-475C-B269-2D5C3A31797C'),
}

model DeleteDBInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteDBInstanceResponseBody(name='body'),
}

/**
 * @param request DeleteDBInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteDBInstanceResponse
 */
async function deleteDBInstanceWithOptions(request: DeleteDBInstanceRequest, runtime: $RuntimeOptions): DeleteDBInstanceResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.DBInstanceName)) {
    query['DBInstanceName'] = request.DBInstanceName;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteDBInstance',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DeleteDBInstanceRequest
 * @return DeleteDBInstanceResponse
 */
async function deleteDBInstance(request: DeleteDBInstanceRequest): DeleteDBInstanceResponse {
  var runtime = new $RuntimeOptions{};
  return deleteDBInstanceWithOptions(request, runtime);
}

model DescribeAccountListRequest {
  accountName?: string(name='AccountName', example='testaccount'),
  accountType?: string(name='AccountType', example='0'),
  DBInstanceName?: string(name='DBInstanceName', description='This parameter is required.', example='pxc-********'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
}

model DescribeAccountListResponseBody = {
  data?: [ 
    {
      accountDescription?: string(name='AccountDescription', example='testaccount desc'),
      accountName?: string(name='AccountName', example='testAccount'),
      accountPrivilege?: string(name='AccountPrivilege', example='ReadWrite'),
      accountType?: string(name='AccountType', example='0'),
      DBInstanceName?: string(name='DBInstanceName', example='pxc-*********'),
      DBName?: string(name='DBName', example='testdb'),
      gmtCreated?: string(name='GmtCreated', example='2012-06-08T15:00Z'),
    }
  ](name='Data'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='9B2F3840-5C98-475C-B269-2D5C3A31797C'),
  success?: boolean(name='Success', example='true'),
}

model DescribeAccountListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAccountListResponseBody(name='body'),
}

/**
 * @param request DescribeAccountListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeAccountListResponse
 */
async function describeAccountListWithOptions(request: DescribeAccountListRequest, runtime: $RuntimeOptions): DescribeAccountListResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.accountName)) {
    query['AccountName'] = request.accountName;
  }
  if (!$isNull(request.accountType)) {
    query['AccountType'] = request.accountType;
  }
  if (!$isNull(request.DBInstanceName)) {
    query['DBInstanceName'] = request.DBInstanceName;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeAccountList',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeAccountListRequest
 * @return DescribeAccountListResponse
 */
async function describeAccountList(request: DescribeAccountListRequest): DescribeAccountListResponse {
  var runtime = new $RuntimeOptions{};
  return describeAccountListWithOptions(request, runtime);
}

model DescribeActiveOperationMaintainConfRequest {
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
}

model DescribeActiveOperationMaintainConfResponseBody = {
  config?: {
    createdTime?: string(name='CreatedTime', example='2021-08-11T10:08:27Z'),
    cycleTime?: string(name='CycleTime', example='1,2,3,4,5,6,7'),
    cycleType?: string(name='CycleType', example='Week'),
    maintainEndTime?: string(name='MaintainEndTime', example='04:00:00Z'),
    maintainStartTime?: string(name='MaintainStartTime', example='04:00:00Z'),
    modifiedTime?: string(name='ModifiedTime', example='2021-08-11T10:08:27Z'),
    status?: long(name='Status', example='1'),
  }(name='Config'),
  hasConfig?: long(name='HasConfig', example='1'),
  requestId?: string(name='RequestId', example='1A586DCB-39A6-4050-81CC-C7BD4CCDB49F'),
}

model DescribeActiveOperationMaintainConfResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeActiveOperationMaintainConfResponseBody(name='body'),
}

/**
 * @summary 展示全局运维窗口配置
 *
 * @param request DescribeActiveOperationMaintainConfRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeActiveOperationMaintainConfResponse
 */
async function describeActiveOperationMaintainConfWithOptions(request: DescribeActiveOperationMaintainConfRequest, runtime: $RuntimeOptions): DescribeActiveOperationMaintainConfResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeActiveOperationMaintainConf',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 展示全局运维窗口配置
 *
 * @param request DescribeActiveOperationMaintainConfRequest
 * @return DescribeActiveOperationMaintainConfResponse
 */
async function describeActiveOperationMaintainConf(request: DescribeActiveOperationMaintainConfRequest): DescribeActiveOperationMaintainConfResponse {
  var runtime = new $RuntimeOptions{};
  return describeActiveOperationMaintainConfWithOptions(request, runtime);
}

model DescribeActiveOperationTaskCountRequest {
  category?: string(name='Category', example='Category'),
  product?: string(name='Product', example='polarx'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
}

model DescribeActiveOperationTaskCountResponseBody = {
  needPop?: long(name='NeedPop', example='1'),
  requestId?: string(name='RequestId', example='EC7E27FC-58F8-4722-89BB-D1B6D0971956'),
  taskCount?: long(name='TaskCount', example='20'),
}

model DescribeActiveOperationTaskCountResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeActiveOperationTaskCountResponseBody(name='body'),
}

/**
 * @summary 获取主动运维任务数量
 *
 * @param request DescribeActiveOperationTaskCountRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeActiveOperationTaskCountResponse
 */
async function describeActiveOperationTaskCountWithOptions(request: DescribeActiveOperationTaskCountRequest, runtime: $RuntimeOptions): DescribeActiveOperationTaskCountResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeActiveOperationTaskCount',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取主动运维任务数量
 *
 * @param request DescribeActiveOperationTaskCountRequest
 * @return DescribeActiveOperationTaskCountResponse
 */
async function describeActiveOperationTaskCount(request: DescribeActiveOperationTaskCountRequest): DescribeActiveOperationTaskCountResponse {
  var runtime = new $RuntimeOptions{};
  return describeActiveOperationTaskCountWithOptions(request, runtime);
}

model DescribeActiveOperationTasksRequest {
  allowCancel?: long(name='AllowCancel', example='-1'),
  allowChange?: long(name='AllowChange', example='-1'),
  changeLevel?: string(name='ChangeLevel', example='all'),
  dbType?: string(name='DbType', example='polarx'),
  insName?: string(name='InsName', example='pxc-xxxxx'),
  pageNumber?: long(name='PageNumber', example='1'),
  pageSize?: long(name='PageSize', example='25'),
  productId?: string(name='ProductId', example='polarx'),
  region?: string(name='Region', example='cn-hangzhou'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  status?: long(name='Status', example='-1'),
  taskType?: string(name='TaskType', example='all'),
}

model DescribeActiveOperationTasksResponseBody = {
  items?: [ 
    {
      allowCancel?: string(name='AllowCancel', example='0'),
      allowChange?: string(name='AllowChange', example='0'),
      changeLevel?: string(name='ChangeLevel', example='Risk'),
      changeLevelEn?: string(name='ChangeLevelEn', example='Risk repairment'),
      changeLevelZh?: string(name='ChangeLevelZh'),
      createdTime?: string(name='CreatedTime', example='2021-06-15T16:00:00Z'),
      currentAVZ?: string(name='CurrentAVZ', example='cn-shanghai-et-a'),
      dbType?: string(name='DbType', example='polarx'),
      dbVersion?: string(name='DbVersion', example='2.0'),
      deadline?: string(name='Deadline', example='2021-06-15T16:00:00Z'),
      id?: long(name='Id', example='1'),
      impact?: string(name='Impact', example='--'),
      impactEn?: string(name='ImpactEn', example='Transient instance disconnection'),
      impactZh?: string(name='ImpactZh'),
      insComment?: string(name='InsComment', example='xxx'),
      insName?: string(name='InsName', example='pxc-dd'),
      modifiedTime?: string(name='ModifiedTime', example='2021-06-15T16:00:00Z'),
      prepareInterval?: string(name='PrepareInterval', example='03:00:00'),
      region?: string(name='Region', example='cn-shanghai-et15-b01'),
      resultInfo?: string(name='ResultInfo', example='--'),
      startTime?: string(name='StartTime', example='2021-06-15T16:00:00Z'),
      status?: long(name='Status', example='3'),
      subInsNames?: [ string ](name='SubInsNames'),
      switchTime?: string(name='SwitchTime', example='2021-06-15T16:00:00Z'),
      taskType?: string(name='TaskType', example='rds_apsaradb_transfer'),
      taskTypeEn?: string(name='TaskTypeEn', example='--'),
      taskTypeZh?: string(name='TaskTypeZh', example='--'),
    }
  ](name='Items'),
  pageNumber?: long(name='PageNumber', example='1'),
  pageSize?: long(name='PageSize', example='12'),
  requestId?: string(name='RequestId', example='xxxx'),
  totalRecordCount?: long(name='TotalRecordCount', example='23'),
}

model DescribeActiveOperationTasksResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeActiveOperationTasksResponseBody(name='body'),
}

/**
 * @summary 获取待执行自动运维任务列表
 *
 * @param request DescribeActiveOperationTasksRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeActiveOperationTasksResponse
 */
async function describeActiveOperationTasksWithOptions(request: DescribeActiveOperationTasksRequest, runtime: $RuntimeOptions): DescribeActiveOperationTasksResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeActiveOperationTasks',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取待执行自动运维任务列表
 *
 * @param request DescribeActiveOperationTasksRequest
 * @return DescribeActiveOperationTasksResponse
 */
async function describeActiveOperationTasks(request: DescribeActiveOperationTasksRequest): DescribeActiveOperationTasksResponse {
  var runtime = new $RuntimeOptions{};
  return describeActiveOperationTasksWithOptions(request, runtime);
}

model DescribeArchiveTableListRequest {
  DBInstanceName?: string(name='DBInstanceName', description='This parameter is required.'),
  pageIndex?: long(name='PageIndex', description='This parameter is required.'),
  pageSize?: long(name='PageSize', description='This parameter is required.'),
  regionId?: string(name='RegionId', description='This parameter is required.'),
  schemaName?: string(name='SchemaName'),
  status?: string(name='Status'),
  tableName?: string(name='TableName'),
}

model DescribeArchiveTableListResponseBody = {
  data?: {
    pageIndex?: long(name='PageIndex'),
    pageSize?: long(name='PageSize'),
    pausedCount?: int32(name='PausedCount'),
    runningCount?: int32(name='RunningCount'),
    successCount?: int32(name='SuccessCount'),
    tables?: [ 
      {
        archiveStatus?: string(name='ArchiveStatus'),
        createdDate?: long(name='CreatedDate'),
        fileCount?: int32(name='FileCount'),
        lastSuccessArchiveTime?: long(name='LastSuccessArchiveTime'),
        schemaName?: string(name='SchemaName'),
        spaceSize?: double(name='SpaceSize'),
        tableName?: string(name='TableName'),
      }
    ](name='Tables'),
    tobeArchivedConut?: int32(name='TobeArchivedConut'),
    total?: long(name='Total'),
  }(name='Data'),
  requestId?: string(name='RequestId'),
}

model DescribeArchiveTableListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeArchiveTableListResponseBody(name='body'),
}

/**
 * @summary 冷存储表列表
 *
 * @param request DescribeArchiveTableListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeArchiveTableListResponse
 */
async function describeArchiveTableListWithOptions(request: DescribeArchiveTableListRequest, runtime: $RuntimeOptions): DescribeArchiveTableListResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.DBInstanceName)) {
    query['DBInstanceName'] = request.DBInstanceName;
  }
  if (!$isNull(request.pageIndex)) {
    query['PageIndex'] = request.pageIndex;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.schemaName)) {
    query['SchemaName'] = request.schemaName;
  }
  if (!$isNull(request.status)) {
    query['Status'] = request.status;
  }
  if (!$isNull(request.tableName)) {
    query['TableName'] = request.tableName;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeArchiveTableList',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 冷存储表列表
 *
 * @param request DescribeArchiveTableListRequest
 * @return DescribeArchiveTableListResponse
 */
async function describeArchiveTableList(request: DescribeArchiveTableListRequest): DescribeArchiveTableListResponse {
  var runtime = new $RuntimeOptions{};
  return describeArchiveTableListWithOptions(request, runtime);
}

model DescribeBackupPolicyRequest {
  DBInstanceName?: string(name='DBInstanceName', description='This parameter is required.', example='pxc-********'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
}

model DescribeBackupPolicyResponseBody = {
  data?: {
    backupPeriod?: string(name='BackupPeriod'),
    backupPlanBegin?: string(name='BackupPlanBegin'),
    backupSetRetention?: int32(name='BackupSetRetention'),
    backupType?: string(name='BackupType'),
    backupWay?: string(name='BackupWay'),
    coldDataBackupInterval?: int32(name='ColdDataBackupInterval'),
    coldDataBackupRetention?: int32(name='ColdDataBackupRetention'),
    crossRegionDataBackupRetention?: int32(name='CrossRegionDataBackupRetention'),
    crossRegionLogBackupRetention?: int32(name='CrossRegionLogBackupRetention'),
    DBInstanceName?: string(name='DBInstanceName'),
    destCrossRegion?: string(name='DestCrossRegion'),
    forceCleanOnHighSpaceUsage?: int32(name='ForceCleanOnHighSpaceUsage'),
    isCrossRegionDataBackupEnabled?: boolean(name='IsCrossRegionDataBackupEnabled'),
    isCrossRegionLogBackupEnabled?: boolean(name='IsCrossRegionLogBackupEnabled'),
    isEnabled?: int32(name='IsEnabled'),
    localLogRetention?: int32(name='LocalLogRetention'),
    localLogRetentionNumber?: int32(name='LocalLogRetentionNumber'),
    logLocalRetentionSpace?: int32(name='LogLocalRetentionSpace'),
    removeLogRetention?: int32(name='RemoveLogRetention'),
  }(name='Data'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='B87E2AB3-B7C9-4394-9160-7F639F732031'),
  success?: boolean(name='Success', example='true'),
}

model DescribeBackupPolicyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeBackupPolicyResponseBody(name='body'),
}

/**
 * @param request DescribeBackupPolicyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeBackupPolicyResponse
 */
async function describeBackupPolicyWithOptions(request: DescribeBackupPolicyRequest, runtime: $RuntimeOptions): DescribeBackupPolicyResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.DBInstanceName)) {
    query['DBInstanceName'] = request.DBInstanceName;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeBackupPolicy',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeBackupPolicyRequest
 * @return DescribeBackupPolicyResponse
 */
async function describeBackupPolicy(request: DescribeBackupPolicyRequest): DescribeBackupPolicyResponse {
  var runtime = new $RuntimeOptions{};
  return describeBackupPolicyWithOptions(request, runtime);
}

model DescribeBackupSetRequest {
  backupSetId?: string(name='BackupSetId', description='This parameter is required.', example='111'),
  DBInstanceName?: string(name='DBInstanceName', description='This parameter is required.', example='pxc-htri0ori2r****'),
  destCrossRegion?: string(name='DestCrossRegion'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model DescribeBackupSetResponseBody = {
  data?: [ 
    {
      backupModel?: int32(name='BackupModel', example='0'),
      backupSetId?: long(name='BackupSetId', example='111'),
      backupSetSize?: long(name='BackupSetSize', example='88803195'),
      backupType?: int32(name='BackupType', example='1'),
      beginTime?: long(name='BeginTime', example='1650250861754'),
      endTime?: long(name='EndTime', example='1650251308000'),
      OSSList?: [ 
        {
          backupSetFile?: string(name='BackupSetFile', example='hins3084_data_20220418110623_qp.xb'),
          downloadLink?: string(name='DownloadLink', example='https://pre-rdsbak-cn-xxx.oss-cn-beijing.aliyuncs.com/custins2255/hins3084_data_20220418110623_qp.xb?OSSAccessKeyId=LTAI5tJEmRFdJ8aBPDR7****&Expires=1650441697&dd=7KJzkUSbXf6dwy'),
          intranetDownloadLink?: string(name='IntranetDownloadLink', example='http://pre-rdsbak-cn-beijing.oss-cn-beijing-internal.aliyuncs.com/custins2255/hins3084_data_20220418110623_qp.xb?'),
          linkExpiredTime?: string(name='LinkExpiredTime', example='2022-04-20T08:01:37Z'),
        }
      ](name='OSSList'),
      status?: int32(name='Status', example='1'),
    }
  ](name='Data'),
  message?: string(name='Message', example='successs'),
  requestId?: string(name='RequestId', example='1A6D328C-84B8-40DC-BF49-6C73984D7494'),
  success?: boolean(name='Success', example='true'),
}

model DescribeBackupSetResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeBackupSetResponseBody(name='body'),
}

/**
 * @summary 备份集详情
 *
 * @param request DescribeBackupSetRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeBackupSetResponse
 */
async function describeBackupSetWithOptions(request: DescribeBackupSetRequest, runtime: $RuntimeOptions): DescribeBackupSetResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.backupSetId)) {
    query['BackupSetId'] = request.backupSetId;
  }
  if (!$isNull(request.DBInstanceName)) {
    query['DBInstanceName'] = request.DBInstanceName;
  }
  if (!$isNull(request.destCrossRegion)) {
    query['DestCrossRegion'] = request.destCrossRegion;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeBackupSet',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 备份集详情
 *
 * @param request DescribeBackupSetRequest
 * @return DescribeBackupSetResponse
 */
async function describeBackupSet(request: DescribeBackupSetRequest): DescribeBackupSetResponse {
  var runtime = new $RuntimeOptions{};
  return describeBackupSetWithOptions(request, runtime);
}

model DescribeBackupSetListRequest {
  DBInstanceName?: string(name='DBInstanceName', description='This parameter is required.', example='pxc-xxxxxx'),
  destCrossRegion?: string(name='DestCrossRegion'),
  endTime?: long(name='EndTime', example='1635707845000'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='30'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  startTime?: long(name='StartTime', example='1635707845000'),
}

model DescribeBackupSetListResponseBody = {
  data?: [ 
    {
      backupModel?: int32(name='BackupModel', example='0'),
      backupSetId?: string(name='BackupSetId', example='111'),
      backupSetSize?: long(name='BackupSetSize', example='88803195'),
      backupType?: int32(name='BackupType', example='1'),
      beginTime?: long(name='BeginTime', example='1635706960956'),
      endTime?: long(name='EndTime', example='1635706960956'),
      status?: int32(name='Status', example='1'),
    }
  ](name='Data'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='1A6D328C-84B8-40DC-BF49-6C73984D7494'),
  success?: boolean(name='Success', example='true'),
}

model DescribeBackupSetListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeBackupSetListResponseBody(name='body'),
}

/**
 * @param request DescribeBackupSetListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeBackupSetListResponse
 */
async function describeBackupSetListWithOptions(request: DescribeBackupSetListRequest, runtime: $RuntimeOptions): DescribeBackupSetListResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeBackupSetList',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeBackupSetListRequest
 * @return DescribeBackupSetListResponse
 */
async function describeBackupSetList(request: DescribeBackupSetListRequest): DescribeBackupSetListResponse {
  var runtime = new $RuntimeOptions{};
  return describeBackupSetListWithOptions(request, runtime);
}

model DescribeBinaryLogListRequest {
  DBInstanceName?: string(name='DBInstanceName', description='This parameter is required.', example='pxc-hz1fds'),
  endTime?: string(name='EndTime', description='This parameter is required.', example='2021-11-09 10:27:46'),
  instanceName?: string(name='InstanceName'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='30'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  startTime?: string(name='StartTime', description='This parameter is required.', example='2021-09-09 10:27:46'),
}

model DescribeBinaryLogListResponseBody = {
  logList?: [ 
    {
      beginTime?: string(name='BeginTime', example='2021-09-09 10:27:46'),
      createdTime?: string(name='CreatedTime', example='2021-09-09 10:27:46'),
      downloadLink?: string(name='DownloadLink', example='http://polarx-cdc-binlog-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/polardbx_cdc/pxc-hzfd132143sfds1/binlog.000001?Expires=1636469502&OSSAccessKeyId=LT13fds12dsafddsf&Signature=fdpm%bdsfadsa%2F%bdsafdsaf%3D'),
      endTime?: string(name='EndTime', example='2021-11-09 10:27:46'),
      fileName?: string(name='FileName', example='binlog.000001'),
      id?: long(name='Id', example='100'),
      logSize?: long(name='LogSize', example='536870912'),
      modifiedTime?: string(name='ModifiedTime', example='2021-11-09 10:27:46'),
      purgeStatus?: int32(name='PurgeStatus', example='0'),
      uploadHost?: string(name='UploadHost', example='10.110.88.9'),
      uploadStatus?: int32(name='UploadStatus', example='2'),
    }
  ](name='LogList'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='30'),
  requestId?: string(name='RequestId', example='2DFF784E-DC31-5BBC-9B25-9261CD9E0AA9'),
  totalNumber?: int32(name='TotalNumber', example='100'),
}

model DescribeBinaryLogListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeBinaryLogListResponseBody(name='body'),
}

/**
 * @param request DescribeBinaryLogListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeBinaryLogListResponse
 */
async function describeBinaryLogListWithOptions(request: DescribeBinaryLogListRequest, runtime: $RuntimeOptions): DescribeBinaryLogListResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.DBInstanceName)) {
    query['DBInstanceName'] = request.DBInstanceName;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.instanceName)) {
    query['InstanceName'] = request.instanceName;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeBinaryLogList',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeBinaryLogListRequest
 * @return DescribeBinaryLogListResponse
 */
async function describeBinaryLogList(request: DescribeBinaryLogListRequest): DescribeBinaryLogListResponse {
  var runtime = new $RuntimeOptions{};
  return describeBinaryLogListWithOptions(request, runtime);
}

model DescribeCdcInfoRequest {
  DBInstanceName?: string(name='DBInstanceName', description='This parameter is required.', example='pxc-********'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-beijing'),
}

model DescribeCdcInfoResponseBody = {
  data?: {
    binlogPersistTime?: int32(name='BinlogPersistTime', example='15'),
    binlogSize?: int32(name='BinlogSize', description='This parameter is required.', example='524288000'),
    cdcNewVersion?: string(name='CdcNewVersion', description='This parameter is required.', example='polarx-cdc-kernel-***'),
    checkSumSwitch?: string(name='CheckSumSwitch', example='ON'),
    enableCyclicReplication?: boolean(name='EnableCyclicReplication', example='true'),
    instanceTopologyList?: [ 
      {
        clusterType?: string(name='ClusterType', example='BINLOG_X'),
        comment?: string(name='Comment', example='***'),
        groupName?: string(name='GroupName', example='test'),
        hashLevel?: string(name='HashLevel', example='RECORD'),
        instanceName?: string(name='InstanceName', example='pxc-***'),
        physicalNodes?: [ 
          {
            AZone?: string(name='AZone', example='cn-hangzhou-h'),
            disk?: int32(name='Disk', example='204800'),
            nodeClass?: string(name='NodeClass', example='polarx.x4.large.2e.cdc'),
            nodeId?: string(name='NodeId', example='***'),
            nodeName?: string(name='NodeName', example='pxc-c-***'),
            status?: string(name='Status', example='ACTIVATION'),
            version?: string(name='Version', example='polarx-cdc-kernel-***'),
          }
        ](name='PhysicalNodes'),
        streamNum?: int32(name='StreamNum', example='2'),
      }
    ](name='InstanceTopologyList'),
    serverId?: int32(name='ServerId', description='server id

This parameter is required.', example='3014767486'),
    versionSupportMultiCdc?: boolean(name='VersionSupportMultiCdc', example='true'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', description='This parameter is required.', example='200'),
  requestId?: string(name='RequestId', description='Id of the request', example='9B2F3840-5C98-475C-B269-2D5C3A31797C'),
  success?: boolean(name='Success', description='This parameter is required.', example='true'),
}

model DescribeCdcInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCdcInfoResponseBody(name='body'),
}

/**
 * @summary 查询CDC信息
 *
 * @param request DescribeCdcInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCdcInfoResponse
 */
async function describeCdcInfoWithOptions(request: DescribeCdcInfoRequest, runtime: $RuntimeOptions): DescribeCdcInfoResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.DBInstanceName)) {
    query['DBInstanceName'] = request.DBInstanceName;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeCdcInfo',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询CDC信息
 *
 * @param request DescribeCdcInfoRequest
 * @return DescribeCdcInfoResponse
 */
async function describeCdcInfo(request: DescribeCdcInfoRequest): DescribeCdcInfoResponse {
  var runtime = new $RuntimeOptions{};
  return describeCdcInfoWithOptions(request, runtime);
}

model DescribeCharacterSetRequest {
  DBInstanceName?: string(name='DBInstanceName', description='This parameter is required.', example='pxc-*********'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
}

model DescribeCharacterSetResponseBody = {
  data?: {
    characterSet?: [ string ](name='CharacterSet'),
    engine?: string(name='Engine', example='polarx'),
  }(name='Data'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='709C1E40-092D-4A3D-9958-6D7438******'),
  success?: boolean(name='Success', example='true'),
}

model DescribeCharacterSetResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCharacterSetResponseBody(name='body'),
}

/**
 * @param request DescribeCharacterSetRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCharacterSetResponse
 */
async function describeCharacterSetWithOptions(request: DescribeCharacterSetRequest, runtime: $RuntimeOptions): DescribeCharacterSetResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.DBInstanceName)) {
    query['DBInstanceName'] = request.DBInstanceName;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeCharacterSet',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeCharacterSetRequest
 * @return DescribeCharacterSetResponse
 */
async function describeCharacterSet(request: DescribeCharacterSetRequest): DescribeCharacterSetResponse {
  var runtime = new $RuntimeOptions{};
  return describeCharacterSetWithOptions(request, runtime);
}

model DescribeColdDataBasicInfoRequest {
  DBInstanceName?: string(name='DBInstanceName', description='This parameter is required.'),
  regionId?: string(name='RegionId', description='This parameter is required.'),
}

model DescribeColdDataBasicInfoResponseBody = {
  data?: {
    backupSetCount?: int32(name='BackupSetCount'),
    backupSetSpaceSize?: double(name='BackupSetSpaceSize'),
    cloudProduct?: string(name='CloudProduct'),
    currentSpaceSize?: double(name='CurrentSpaceSize'),
    dataRedundancyType?: string(name='DataRedundancyType'),
    enableStatus?: boolean(name='EnableStatus'),
    readAccessNum?: long(name='ReadAccessNum'),
    regionId?: string(name='RegionId'),
    volumeName?: string(name='VolumeName'),
    writeAccessNum?: double(name='WriteAccessNum'),
  }(name='Data'),
  requestId?: string(name='RequestId'),
}

model DescribeColdDataBasicInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeColdDataBasicInfoResponseBody(name='body'),
}

/**
 * @summary 冷存储基础信息
 *
 * @param request DescribeColdDataBasicInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeColdDataBasicInfoResponse
 */
async function describeColdDataBasicInfoWithOptions(request: DescribeColdDataBasicInfoRequest, runtime: $RuntimeOptions): DescribeColdDataBasicInfoResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeColdDataBasicInfo',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 冷存储基础信息
 *
 * @param request DescribeColdDataBasicInfoRequest
 * @return DescribeColdDataBasicInfoResponse
 */
async function describeColdDataBasicInfo(request: DescribeColdDataBasicInfoRequest): DescribeColdDataBasicInfoResponse {
  var runtime = new $RuntimeOptions{};
  return describeColdDataBasicInfoWithOptions(request, runtime);
}

model DescribeDBInstanceAttributeRequest {
  DBInstanceName?: string(name='DBInstanceName', description='This parameter is required.', example='pxc-********'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', example='rg-aekzaxhezhs5***'),
}

model DescribeDBInstanceAttributeResponseBody = {
  DBInstance?: {
    canNotCreateColumnar?: boolean(name='CanNotCreateColumnar'),
    cnNodeClassCode?: string(name='CnNodeClassCode', example='polarx.x4.xlarge.2e'),
    cnNodeCount?: int32(name='CnNodeCount', example='2'),
    columnarInstanceName?: string(name='ColumnarInstanceName'),
    columnarReadDBInstances?: [ string ](name='ColumnarReadDBInstances'),
    commodityCode?: string(name='CommodityCode', example='drds_polarxpost_public_cn'),
    connAddrs?: [ 
      {
        connectionString?: string(name='ConnectionString', example='polardbx-xxx.aliyuncs.com'),
        port?: long(name='Port', example='3306'),
        type?: string(name='Type', example='VPC'),
        VPCId?: string(name='VPCId', description='VPC ID。', example='vpc-xxxxxx'),
        vSwitchId?: string(name='VSwitchId'),
        vpcInstanceId?: string(name='VpcInstanceId', example='pxc-zkralxpc5d****'),
      }
    ](name='ConnAddrs'),
    connectionString?: string(name='ConnectionString'),
    createTime?: string(name='CreateTime', example='2021-08-31T08:56:25.000+0000'),
    DBInstanceType?: string(name='DBInstanceType', example='ReadWrite'),
    DBNodeClass?: string(name='DBNodeClass', example='polarx.x4.large.2e'),
    DBNodeCount?: int32(name='DBNodeCount', example='2'),
    DBNodes?: [ 
      {
        computeNodeId?: string(name='ComputeNodeId'),
        dataNodeId?: string(name='DataNodeId', example='pxc-xdb-xxxxxx'),
        id?: string(name='Id'),
        nodeClass?: string(name='NodeClass', example='polarx.x4.large.2e'),
        regionId?: string(name='RegionId', example='cn-hangzhou'),
        zoneId?: string(name='ZoneId', example='cn-hangzhou-a'),
      }
    ](name='DBNodes'),
    DBType?: string(name='DBType', example='polarx'),
    DBVersion?: string(name='DBVersion', example='5.5'),
    description?: string(name='Description', example='test instance'),
    differentDNSpec?: boolean(name='DifferentDNSpec'),
    dnNodeClassCode?: string(name='DnNodeClassCode', example='mysql.x8.large.25'),
    dnNodeCount?: int32(name='DnNodeCount', example='2'),
    engine?: string(name='Engine', example='polarx'),
    expireDate?: string(name='ExpireDate', example='2022-08-31T16:00:00.000+0000'),
    expired?: string(name='Expired', example='false'),
    gdnInstanceName?: string(name='GdnInstanceName'),
    gdnMemberList?: [ 
      {
        memberName?: string(name='MemberName'),
        role?: string(name='Role'),
        status?: string(name='Status'),
      }
    ](name='GdnMemberList'),
    gdnRole?: string(name='GdnRole'),
    id?: string(name='Id', example='pxc-zkralxpc5d****'),
    kindCode?: int32(name='KindCode', example='18'),
    LTSVersions?: [ string ](name='LTSVersions', description='This parameter is required.'),
    latestMinorVersion?: string(name='LatestMinorVersion', example='polarx-kernel_5.4.11-16301083_xcluster-20210805'),
    lockMode?: string(name='LockMode', example='Unlock'),
    maintainEndTime?: string(name='MaintainEndTime', example='06:00'),
    maintainStartTime?: string(name='MaintainStartTime', example='06:00'),
    minorVersion?: string(name='MinorVersion', example='polarx-kernel_5.4.11-16301083_xcluster-20210805'),
    network?: string(name='Network', example='VPC'),
    payType?: string(name='PayType', example='Postpaid'),
    port?: string(name='Port', example='3306'),
    primaryInstanceId?: string(name='PrimaryInstanceId'),
    primaryZone?: string(name='PrimaryZone', description='主可用区。

This parameter is required.'),
    readDBInstances?: [ string ](name='ReadDBInstances'),
    regionId?: string(name='RegionId', example='cn-hangzhou'),
    resourceGroupId?: string(name='ResourceGroupId', example='rg-xxxx'),
    rightsSeparationEnabled?: boolean(name='RightsSeparationEnabled', example='false'),
    rightsSeparationStatus?: string(name='RightsSeparationStatus', example='disabled'),
    secondaryZone?: string(name='SecondaryZone', description='次可用区。'),
    series?: string(name='Series', example='enterprise'),
    specCategory?: string(name='SpecCategory'),
    status?: string(name='Status', example='Running'),
    storageUsed?: long(name='StorageUsed', example='17042505728'),
    tagSet?: [ 
      {
        key?: string(name='Key', example='key2'),
        value?: string(name='Value', example='value2'),
      }
    ](name='TagSet'),
    tertiaryZone?: string(name='TertiaryZone', description='第三可用区。'),
    topologyType?: string(name='TopologyType', description='拓扑类型：

- **3azones**：三可用区；
- **1azone**：单可用区。

This parameter is required.'),
    type?: string(name='Type', example='ReadWrite'),
    VPCId?: string(name='VPCId', description='VPC ID。', example='vpc-xxxxx'),
    vSwitchId?: string(name='VSwitchId'),
    zoneId?: string(name='ZoneId', example='cn-hangzhou-a'),
  }(name='DBInstance'),
  requestId?: string(name='RequestId', example='9B2F3840-5C98-475C-B269-2D5C3A31797C'),
}

model DescribeDBInstanceAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDBInstanceAttributeResponseBody(name='body'),
}

/**
 * @param request DescribeDBInstanceAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDBInstanceAttributeResponse
 */
async function describeDBInstanceAttributeWithOptions(request: DescribeDBInstanceAttributeRequest, runtime: $RuntimeOptions): DescribeDBInstanceAttributeResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.DBInstanceName)) {
    query['DBInstanceName'] = request.DBInstanceName;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDBInstanceAttribute',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeDBInstanceAttributeRequest
 * @return DescribeDBInstanceAttributeResponse
 */
async function describeDBInstanceAttribute(request: DescribeDBInstanceAttributeRequest): DescribeDBInstanceAttributeResponse {
  var runtime = new $RuntimeOptions{};
  return describeDBInstanceAttributeWithOptions(request, runtime);
}

model DescribeDBInstanceConfigRequest {
  configName?: string(name='ConfigName', description='This parameter is required.', example='htap'),
  DBInstanceName?: string(name='DBInstanceName', description='This parameter is required.', example='pxc-*********'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
}

model DescribeDBInstanceConfigResponseBody = {
  data?: {
    configName?: string(name='ConfigName', example='htap'),
    configValue?: string(name='ConfigValue'),
    dbInstanceName?: string(name='DbInstanceName'),
  }(name='Data'),
  requestId?: string(name='RequestId', example='C458B1E8-1683-3645-B154-6BA32080EEA'),
}

model DescribeDBInstanceConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDBInstanceConfigResponseBody(name='body'),
}

/**
 * @param request DescribeDBInstanceConfigRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDBInstanceConfigResponse
 */
async function describeDBInstanceConfigWithOptions(request: DescribeDBInstanceConfigRequest, runtime: $RuntimeOptions): DescribeDBInstanceConfigResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.configName)) {
    query['ConfigName'] = request.configName;
  }
  if (!$isNull(request.DBInstanceName)) {
    query['DBInstanceName'] = request.DBInstanceName;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDBInstanceConfig',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeDBInstanceConfigRequest
 * @return DescribeDBInstanceConfigResponse
 */
async function describeDBInstanceConfig(request: DescribeDBInstanceConfigRequest): DescribeDBInstanceConfigResponse {
  var runtime = new $RuntimeOptions{};
  return describeDBInstanceConfigWithOptions(request, runtime);
}

model DescribeDBInstanceHARequest {
  DBInstanceName?: string(name='DBInstanceName', description='This parameter is required.'),
  regionId?: string(name='RegionId', description='This parameter is required.'),
}

model DescribeDBInstanceHAResponseBody = {
  data?: {
    primaryAzoneId?: string(name='PrimaryAzoneId'),
    primaryRegionId?: string(name='PrimaryRegionId'),
    secondaryAzoneId?: string(name='SecondaryAzoneId'),
    secondaryRegionId?: string(name='SecondaryRegionId'),
    topologyType?: string(name='TopologyType'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DescribeDBInstanceHAResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDBInstanceHAResponseBody(name='body'),
}

/**
 * @param request DescribeDBInstanceHARequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDBInstanceHAResponse
 */
async function describeDBInstanceHAWithOptions(request: DescribeDBInstanceHARequest, runtime: $RuntimeOptions): DescribeDBInstanceHAResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.DBInstanceName)) {
    query['DBInstanceName'] = request.DBInstanceName;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDBInstanceHA',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeDBInstanceHARequest
 * @return DescribeDBInstanceHAResponse
 */
async function describeDBInstanceHA(request: DescribeDBInstanceHARequest): DescribeDBInstanceHAResponse {
  var runtime = new $RuntimeOptions{};
  return describeDBInstanceHAWithOptions(request, runtime);
}

model DescribeDBInstanceSSLRequest {
  DBInstanceName?: string(name='DBInstanceName', example='pxc-*********'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model DescribeDBInstanceSSLResponseBody = {
  data?: {
    certCommonName?: string(name='CertCommonName', example='pxc-sddddddcym7g7w****.polarx.singapore.rds.aliyuncs.com'),
    SSLEnabled?: boolean(name='SSLEnabled', example='false'),
    SSLExpiredTime?: string(name='SSLExpiredTime', example='2022-11-04T09:39:07Z'),
  }(name='Data'),
  requestId?: string(name='RequestId', example='C458B1E8-1683-3645-B154-6BA32080EEA'),
}

model DescribeDBInstanceSSLResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDBInstanceSSLResponseBody(name='body'),
}

/**
 * @param request DescribeDBInstanceSSLRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDBInstanceSSLResponse
 */
async function describeDBInstanceSSLWithOptions(request: DescribeDBInstanceSSLRequest, runtime: $RuntimeOptions): DescribeDBInstanceSSLResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.DBInstanceName)) {
    query['DBInstanceName'] = request.DBInstanceName;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDBInstanceSSL',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeDBInstanceSSLRequest
 * @return DescribeDBInstanceSSLResponse
 */
async function describeDBInstanceSSL(request: DescribeDBInstanceSSLRequest): DescribeDBInstanceSSLResponse {
  var runtime = new $RuntimeOptions{};
  return describeDBInstanceSSLWithOptions(request, runtime);
}

model DescribeDBInstanceTDERequest {
  DBInstanceName?: string(name='DBInstanceName', example='pxc-********'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model DescribeDBInstanceTDEResponseBody = {
  data?: {
    TDEStatus?: string(name='TDEStatus', example='0'),
  }(name='Data'),
  requestId?: string(name='RequestId', example='C458B1E8-1683-3645-B154-6BA32080EEA'),
}

model DescribeDBInstanceTDEResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDBInstanceTDEResponseBody(name='body'),
}

/**
 * @param request DescribeDBInstanceTDERequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDBInstanceTDEResponse
 */
async function describeDBInstanceTDEWithOptions(request: DescribeDBInstanceTDERequest, runtime: $RuntimeOptions): DescribeDBInstanceTDEResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.DBInstanceName)) {
    query['DBInstanceName'] = request.DBInstanceName;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDBInstanceTDE',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeDBInstanceTDERequest
 * @return DescribeDBInstanceTDEResponse
 */
async function describeDBInstanceTDE(request: DescribeDBInstanceTDERequest): DescribeDBInstanceTDEResponse {
  var runtime = new $RuntimeOptions{};
  return describeDBInstanceTDEWithOptions(request, runtime);
}

model DescribeDBInstanceTopologyRequest {
  DBInstanceName?: string(name='DBInstanceName', description='This parameter is required.', example='pxc-********'),
  endTime?: string(name='EndTime'),
  minuteSimple?: boolean(name='MinuteSimple'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  startTime?: string(name='StartTime'),
}

model DescribeDBInstanceTopologyResponseBody = {
  data?: {
    logicInstanceTopology?: {
      DBInstanceConnType?: string(name='DBInstanceConnType', example='lvs'),
      DBInstanceCreateTime?: string(name='DBInstanceCreateTime', example='2021-10-21T10:30:45Z 04:00:00'),
      DBInstanceDescription?: string(name='DBInstanceDescription', example='pxc-sprcym7g7wj7k'),
      DBInstanceId?: string(name='DBInstanceId', example='304726047'),
      DBInstanceName?: string(name='DBInstanceName', example='pxc-sprcym7g7w****'),
      DBInstanceStatus?: int32(name='DBInstanceStatus', example='8'),
      DBInstanceStatusDescription?: string(name='DBInstanceStatusDescription', example='TDE_MODIFYING'),
      DBInstanceStorage?: int32(name='DBInstanceStorage', example='1'),
      engine?: string(name='Engine', example='polarx'),
      engineVersion?: string(name='EngineVersion', example='2.0'),
      historyItems?: [ 
        {
          activated?: boolean(name='Activated'),
          azone?: string(name='Azone'),
          characterType?: string(name='CharacterType'),
          DBInstanceId?: string(name='DBInstanceId'),
          DBInstanceName?: string(name='DBInstanceName'),
          phyInstanceName?: string(name='PhyInstanceName'),
          region?: string(name='Region'),
          role?: string(name='Role'),
        }
      ](name='HistoryItems'),
      items?: [ 
        {
          activated?: boolean(name='Activated', example='true'),
          azone?: string(name='Azone', example='cn-hangzhou-a'),
          azoneRoleList?: [ 
            {
              azone?: string(name='Azone', example='cn-hangzhou-a'),
              role?: string(name='Role', example='leader'),
            }
          ](name='AzoneRoleList'),
          characterType?: string(name='CharacterType'),
          connectionIp?: [ 
            {
              connectionString?: string(name='ConnectionString', example='pxc-xdb-m-pxcdym7g7w********.mysql.singapore.rds.aliyuncs.com'),
              DBInstanceNetType?: int32(name='DBInstanceNetType', example='1'),
              port?: string(name='Port', example='3306'),
            }
          ](name='ConnectionIp'),
          DBInstanceConnType?: int32(name='DBInstanceConnType'),
          DBInstanceCreateTime?: string(name='DBInstanceCreateTime', example='2021-10-21T10:30:45Z'),
          DBInstanceDescription?: string(name='DBInstanceDescription'),
          DBInstanceId?: string(name='DBInstanceId', example='304726049'),
          DBInstanceName?: string(name='DBInstanceName', example='pxc-i-tk6t4z****'),
          DBInstanceStatus?: int32(name='DBInstanceStatus', example='8'),
          DBInstanceStatusDescription?: string(name='DBInstanceStatusDescription'),
          diskSize?: long(name='DiskSize', example='3145728'),
          engine?: string(name='Engine', example='mysql'),
          engineVersion?: string(name='EngineVersion', example='5.7'),
          lockMode?: int32(name='LockMode', example='0'),
          lockReason?: string(name='LockReason'),
          maintainEndTime?: string(name='MaintainEndTime'),
          maintainStartTime?: string(name='MaintainStartTime'),
          maxConnections?: int32(name='MaxConnections', example='4000'),
          maxIops?: int32(name='MaxIops', example='7000'),
          nodeClass?: string(name='NodeClass', example='polarx.x4.large.2e'),
          phyInstanceName?: string(name='PhyInstanceName'),
          region?: string(name='Region', example='cn-hangzhou'),
          role?: string(name='Role', example='master'),
          status?: string(name='Status', example='0'),
          storageUsed?: string(name='StorageUsed'),
          version?: string(name='Version', example='polarx-cdc-kernel-2.0.0-3985896'),
        }
      ](name='Items'),
      lockMode?: int32(name='LockMode', example='0'),
      lockReason?: string(name='LockReason'),
      maintainEndTime?: string(name='MaintainEndTime', example='05:00:00'),
      maintainStartTime?: string(name='MaintainStartTime', example='04:00:00'),
    }(name='LogicInstanceTopology'),
  }(name='Data'),
  requestId?: string(name='RequestId', example='C458B1E8-1683-3645-B154-6BA32080EEA'),
}

model DescribeDBInstanceTopologyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDBInstanceTopologyResponseBody(name='body'),
}

/**
 * @param request DescribeDBInstanceTopologyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDBInstanceTopologyResponse
 */
async function describeDBInstanceTopologyWithOptions(request: DescribeDBInstanceTopologyRequest, runtime: $RuntimeOptions): DescribeDBInstanceTopologyResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.DBInstanceName)) {
    query['DBInstanceName'] = request.DBInstanceName;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.minuteSimple)) {
    query['MinuteSimple'] = request.minuteSimple;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDBInstanceTopology',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeDBInstanceTopologyRequest
 * @return DescribeDBInstanceTopologyResponse
 */
async function describeDBInstanceTopology(request: DescribeDBInstanceTopologyRequest): DescribeDBInstanceTopologyResponse {
  var runtime = new $RuntimeOptions{};
  return describeDBInstanceTopologyWithOptions(request, runtime);
}

model DescribeDBInstanceViaEndpointRequest {
  endpoint?: string(name='Endpoint', description='This parameter is required.', example='pxc-hz*******.polarx.rds.aliyuncs.com'),
  regionId?: string(name='RegionId', description='This parameter is required.'),
}

model DescribeDBInstanceViaEndpointResponseBody = {
  DBInstance?: {
    cnNodeClassCode?: string(name='CnNodeClassCode', example='polarx.x4.xlarge.2e'),
    cnNodeCount?: int32(name='CnNodeCount', example='2'),
    commodityCode?: string(name='CommodityCode', example='drds_polarxpost_public_cn'),
    connAddrs?: [ 
      {
        connectionString?: string(name='ConnectionString', example='polardbx-xxx.aliyuncs.com'),
        port?: long(name='Port', example='3306'),
        type?: string(name='Type', example='VPC'),
        VPCId?: string(name='VPCId', description='VPC ID。', example='vpc-xxxxxx'),
        vSwitchId?: string(name='VSwitchId', example='vsw-*********'),
        vpcInstanceId?: string(name='VpcInstanceId', example='pxc-zkralxpc5d****'),
      }
    ](name='ConnAddrs'),
    connectionString?: string(name='ConnectionString', example='pxc-sprpx766vo****.polarx.singapore.rds.aliyuncs.com'),
    createTime?: string(name='CreateTime', example='2021-08-31T08:56:25.000+0000'),
    DBInstanceType?: string(name='DBInstanceType', example='ReadWrite'),
    DBNodeClass?: string(name='DBNodeClass', example='polarx.x4.large.2e'),
    DBNodeCount?: int32(name='DBNodeCount', example='2'),
    DBNodes?: [ 
      {
        computeNodeId?: string(name='ComputeNodeId', example='pxc-i-********'),
        dataNodeId?: string(name='DataNodeId', example='pxc-xdb-xxxxxx'),
        id?: string(name='Id', example='pxi-*********'),
        nodeClass?: string(name='NodeClass', example='polarx.x4.large.2e'),
        regionId?: string(name='RegionId', example='cn-hangzhou'),
        zoneId?: string(name='ZoneId', example='cn-hangzhou-a'),
      }
    ](name='DBNodes'),
    DBType?: string(name='DBType', example='polarx'),
    DBVersion?: string(name='DBVersion', example='5.5'),
    description?: string(name='Description', example='test instance'),
    dnNodeClassCode?: string(name='DnNodeClassCode', example='mysql.x8.large.25'),
    dnNodeCount?: int32(name='DnNodeCount', example='2'),
    engine?: string(name='Engine', example='MySQL'),
    expireDate?: string(name='ExpireDate', example='2022-08-31T16:00:00.000+0000'),
    expired?: string(name='Expired', example='false'),
    id?: string(name='Id', example='pxc-zkralxpc5d****'),
    kindCode?: int32(name='KindCode', example='18'),
    LTSVersions?: [ string ](name='LTSVersions', description='This parameter is required.'),
    latestMinorVersion?: string(name='LatestMinorVersion', example='polarx-kernel_5.4.11-16301083_xcluster-20210805'),
    lockMode?: string(name='LockMode', example='Unlock'),
    maintainEndTime?: string(name='MaintainEndTime', example='06:00'),
    maintainStartTime?: string(name='MaintainStartTime', example='06:00'),
    minorVersion?: string(name='MinorVersion', example='polarx-kernel_5.4.11-16301083_xcluster-20210805'),
    network?: string(name='Network', example='VPC'),
    payType?: string(name='PayType', example='Postpaid'),
    port?: string(name='Port', example='3306'),
    readDBInstances?: [ string ](name='ReadDBInstances'),
    regionId?: string(name='RegionId', example='cn-hangzhou'),
    resourceGroupId?: string(name='ResourceGroupId', example='rg-xxxx'),
    rightsSeparationEnabled?: boolean(name='RightsSeparationEnabled', example='false'),
    rightsSeparationStatus?: string(name='RightsSeparationStatus', example='disabled'),
    series?: string(name='Series', example='enterprise'),
    status?: string(name='Status', example='Running'),
    storageUsed?: long(name='StorageUsed', example='17042505728'),
    tagSet?: [ 
      {
        key?: string(name='Key', example='key2'),
        value?: string(name='Value', example='value2'),
      }
    ](name='TagSet'),
    type?: string(name='Type', example='ReadWrite'),
    VPCId?: string(name='VPCId', description='VPC ID。', example='vpc-xxxxx'),
    vSwitchId?: string(name='VSwitchId', example='vsw-********'),
    zoneId?: string(name='ZoneId', example='cn-hangzhou-a'),
  }(name='DBInstance'),
  requestId?: string(name='RequestId', example='14036EBE-CF2E-44DB-ACE9-AC6157D3A6FC'),
}

model DescribeDBInstanceViaEndpointResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDBInstanceViaEndpointResponseBody(name='body'),
}

/**
 * @summary 通过Endpoint查询实例
 *
 * @param request DescribeDBInstanceViaEndpointRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDBInstanceViaEndpointResponse
 */
async function describeDBInstanceViaEndpointWithOptions(request: DescribeDBInstanceViaEndpointRequest, runtime: $RuntimeOptions): DescribeDBInstanceViaEndpointResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.endpoint)) {
    query['Endpoint'] = request.endpoint;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDBInstanceViaEndpoint',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 通过Endpoint查询实例
 *
 * @param request DescribeDBInstanceViaEndpointRequest
 * @return DescribeDBInstanceViaEndpointResponse
 */
async function describeDBInstanceViaEndpoint(request: DescribeDBInstanceViaEndpointRequest): DescribeDBInstanceViaEndpointResponse {
  var runtime = new $RuntimeOptions{};
  return describeDBInstanceViaEndpointWithOptions(request, runtime);
}

model DescribeDBInstancesRequest {
  dbVersion?: string(name='DbVersion'),
  instanceId?: string(name='InstanceId', example='dinga93c84f4d***'),
  mustHasCdc?: boolean(name='MustHasCdc'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='20'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', example='rg-acfmyst47hjw***'),
  series?: string(name='Series', example='enterprise'),
  tags?: string(name='Tags', example='[{\\\\"TagKey\\\\":\\\\"test\\\\",\\\\"TagValue\\\\":\\\\"test-value\\\\"}]'),
}

model DescribeDBInstancesResponseBody = {
  DBInstances?: [ 
    {
      cdcInstanceName?: string(name='CdcInstanceName', example='pxc-c-dmlgit****'),
      cnNodeClassCode?: string(name='CnNodeClassCode', example='polarx.x4.large.2e'),
      cnNodeCount?: int32(name='CnNodeCount', example='2'),
      columnarInstanceName?: string(name='ColumnarInstanceName'),
      columnarReadDBInstances?: [ string ](name='ColumnarReadDBInstances'),
      commodityCode?: string(name='CommodityCode', example='drds_polarxpre_public_cn'),
      containBinlogX?: boolean(name='ContainBinlogX', example='true'),
      cpuType?: string(name='CpuType'),
      createTime?: string(name='CreateTime', example='2021-11-01T03:49:50.000+0000'),
      DBInstanceName?: string(name='DBInstanceName', example='pxc-xxxxx'),
      DBType?: string(name='DBType', example='polarx'),
      DBVersion?: string(name='DBVersion', example='5.7'),
      description?: string(name='Description'),
      dnNodeClassCode?: string(name='DnNodeClassCode', example='mysql.n4.medium.25'),
      dnNodeCount?: int32(name='DnNodeCount', example='2'),
      engine?: string(name='Engine', example='polarx'),
      expireTime?: string(name='ExpireTime', example='2021-12-01T16:00:00.000+0000'),
      expired?: boolean(name='Expired', example='false'),
      id?: string(name='Id', example='pxc-hzr2yeov9jmg3z'),
      lockMode?: string(name='LockMode', example='Unlock'),
      lockReason?: string(name='LockReason'),
      minorVersion?: string(name='MinorVersion', example='polarx-kernel_5.4.12-16349923_xcluster-20210926'),
      network?: string(name='Network', example='VPC'),
      nodeClass?: string(name='NodeClass', example='polarx.x4.large.2e'),
      nodeCount?: int32(name='NodeCount', example='5'),
      nodes?: [ 
        {
          classCode?: string(name='ClassCode', example='polarx.x4.large.2e'),
          id?: string(name='Id'),
          regionId?: string(name='RegionId', example='cn-hangzhou-g-aliyun'),
          zoneId?: string(name='ZoneId', example='cn-hangzhou-g'),
        }
      ](name='Nodes'),
      payType?: string(name='PayType', example='Prepaid'),
      primaryInstanceId?: string(name='PrimaryInstanceId'),
      primaryZone?: string(name='PrimaryZone', description='主可用区。

This parameter is required.'),
      readDBInstances?: [ string ](name='ReadDBInstances'),
      regionId?: string(name='RegionId', example='cn-hangzhou'),
      resourceGroupId?: string(name='ResourceGroupId', example='rg-xxxxxx'),
      secondaryZone?: string(name='SecondaryZone', description='次可用区。'),
      series?: string(name='Series', example='enterprise'),
      status?: string(name='Status', example='Running'),
      storageUsed?: long(name='StorageUsed', example='40658534400'),
      supportBinlogX?: boolean(name='SupportBinlogX', example='true'),
      tagSet?: [ 
        {
          key?: string(name='Key', example='key1'),
          value?: string(name='Value', example='value1'),
        }
      ](name='TagSet'),
      tertiaryZone?: string(name='TertiaryZone', description='第三可用区。'),
      topologyType?: string(name='TopologyType', description='拓扑类型：

- **3azones**：三可用区；
- **1azone**：单可用区。

This parameter is required.'),
      type?: string(name='Type', example='ReadWrite'),
      VPCId?: string(name='VPCId', description='VPC ID。', example='VPCID'),
      zoneId?: string(name='ZoneId', example='cn-hangzhou-g'),
      gdnRole?: string(name='gdnRole'),
      isInGdn?: boolean(name='isInGdn'),
    }
  ](name='DBInstances'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='30'),
  requestId?: string(name='RequestId', example='C458B1E8-1683-3645-B154-6BA32080EEA'),
  totalNumber?: int32(name='TotalNumber', example='30'),
}

model DescribeDBInstancesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDBInstancesResponseBody(name='body'),
}

/**
 * @param request DescribeDBInstancesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDBInstancesResponse
 */
async function describeDBInstancesWithOptions(request: DescribeDBInstancesRequest, runtime: $RuntimeOptions): DescribeDBInstancesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.dbVersion)) {
    query['DbVersion'] = request.dbVersion;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.mustHasCdc)) {
    query['MustHasCdc'] = request.mustHasCdc;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!$isNull(request.series)) {
    query['Series'] = request.series;
  }
  if (!$isNull(request.tags)) {
    query['Tags'] = request.tags;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDBInstances',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeDBInstancesRequest
 * @return DescribeDBInstancesResponse
 */
async function describeDBInstances(request: DescribeDBInstancesRequest): DescribeDBInstancesResponse {
  var runtime = new $RuntimeOptions{};
  return describeDBInstancesWithOptions(request, runtime);
}

model DescribeDBNodePerformanceRequest {
  characterType?: string(name='CharacterType', description='This parameter is required.', example='polarx_cn'),
  DBInstanceName?: string(name='DBInstanceName', description='This parameter is required.', example='pxc-*******'),
  DBNodeIds?: string(name='DBNodeIds', description='This parameter is required.', example='pxc-i-******,pxc-i-*******'),
  DBNodeRole?: string(name='DBNodeRole', example='master'),
  endTime?: string(name='EndTime', description='This parameter is required.', example='2012-06-18T15:00Z'),
  key?: string(name='Key', description='This parameter is required.', example='Cpu_Usage,Mem_Usage'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  startTime?: string(name='StartTime', description='This parameter is required.', example='2012-06-08T15:00Z'),
}

model DescribeDBNodePerformanceResponseBody = {
  DBInstanceName?: string(name='DBInstanceName', example='pxc-********'),
  endTime?: string(name='EndTime', example='2021-10-20T02:00Z'),
  performanceKeys?: {
    performanceItem?: [ 
    {
      DBNodeId?: string(name='DBNodeId', example='pxc-i-********'),
      measurement?: string(name='Measurement', example='Logic_TPS'),
      metricName?: string(name='MetricName', example='logic_tps'),
      points?: {
        performanceItemValue?: [ 
        {
          timestamp?: long(name='Timestamp', example='1600822800000'),
          value?: string(name='Value', example='42.38'),
        }
      ](name='PerformanceItemValue')
      }(name='Points'),
    }
  ](name='PerformanceItem')
  }(name='PerformanceKeys'),
  requestId?: string(name='RequestId', example='EFB5E10B-5268-170F-A378-9AF86CCEACC8'),
  startTime?: string(name='StartTime', example='2021-10-20T00:00Z'),
}

model DescribeDBNodePerformanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDBNodePerformanceResponseBody(name='body'),
}

/**
 * @summary 性能监控数据接口
 *
 * @param request DescribeDBNodePerformanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDBNodePerformanceResponse
 */
async function describeDBNodePerformanceWithOptions(request: DescribeDBNodePerformanceRequest, runtime: $RuntimeOptions): DescribeDBNodePerformanceResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.characterType)) {
    query['CharacterType'] = request.characterType;
  }
  if (!$isNull(request.DBInstanceName)) {
    query['DBInstanceName'] = request.DBInstanceName;
  }
  if (!$isNull(request.DBNodeIds)) {
    query['DBNodeIds'] = request.DBNodeIds;
  }
  if (!$isNull(request.DBNodeRole)) {
    query['DBNodeRole'] = request.DBNodeRole;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.key)) {
    query['Key'] = request.key;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDBNodePerformance',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 性能监控数据接口
 *
 * @param request DescribeDBNodePerformanceRequest
 * @return DescribeDBNodePerformanceResponse
 */
async function describeDBNodePerformance(request: DescribeDBNodePerformanceRequest): DescribeDBNodePerformanceResponse {
  var runtime = new $RuntimeOptions{};
  return describeDBNodePerformanceWithOptions(request, runtime);
}

model DescribeDbListRequest {
  DBInstanceName?: string(name='DBInstanceName', description='This parameter is required.', example='pxc-********'),
  DBName?: string(name='DBName', example='db_name'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
}

model DescribeDbListResponseBody = {
  data?: [ 
    {
      accounts?: [ 
        {
          accountName?: string(name='AccountName', example='root4test'),
          accountPrivilege?: string(name='AccountPrivilege', example='ReadWrite'),
        }
      ](name='Accounts'),
      characterSetName?: string(name='CharacterSetName', example='utf8mb4'),
      DBDescription?: string(name='DBDescription', example='test'),
      DBInstanceName?: string(name='DBInstanceName', example='pxc-********'),
      DBName?: string(name='DBName', example='test'),
    }
  ](name='Data'),
  message?: string(name='Message', example='Success'),
  requestId?: string(name='RequestId', example='C458B1E8-1683-3645-B154-6BA32080EEA'),
  success?: boolean(name='Success', example='true'),
}

model DescribeDbListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDbListResponseBody(name='body'),
}

/**
 * @param request DescribeDbListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDbListResponse
 */
async function describeDbListWithOptions(request: DescribeDbListRequest, runtime: $RuntimeOptions): DescribeDbListResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.DBInstanceName)) {
    query['DBInstanceName'] = request.DBInstanceName;
  }
  if (!$isNull(request.DBName)) {
    query['DBName'] = request.DBName;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDbList',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeDbListRequest
 * @return DescribeDbListResponse
 */
async function describeDbList(request: DescribeDbListRequest): DescribeDbListResponse {
  var runtime = new $RuntimeOptions{};
  return describeDbListWithOptions(request, runtime);
}

model DescribeDistributeTableListRequest {
  DBInstanceName?: string(name='DBInstanceName', description='This parameter is required.', example='pxc-********'),
  dbName?: string(name='DbName', description='This parameter is required.', example='sbtest1'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
}

model DescribeDistributeTableListResponseBody = {
  data?: {
    tables?: [ 
      {
        dbKey?: string(name='DbKey', example='id'),
        tableName?: string(name='TableName', example='sbtest1'),
        tableType?: string(name='TableType', example='multi'),
        tbKey?: string(name='TbKey', example='“”'),
      }
    ](name='Tables'),
  }(name='Data'),
  message?: string(name='Message', example='Success'),
  requestId?: string(name='RequestId', example='C458B1E8-1683-3645-B154-6BA32080EEA'),
  success?: boolean(name='Success', example='true'),
}

model DescribeDistributeTableListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDistributeTableListResponseBody(name='body'),
}

/**
 * @param request DescribeDistributeTableListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDistributeTableListResponse
 */
async function describeDistributeTableListWithOptions(request: DescribeDistributeTableListRequest, runtime: $RuntimeOptions): DescribeDistributeTableListResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.DBInstanceName)) {
    query['DBInstanceName'] = request.DBInstanceName;
  }
  if (!$isNull(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDistributeTableList',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeDistributeTableListRequest
 * @return DescribeDistributeTableListResponse
 */
async function describeDistributeTableList(request: DescribeDistributeTableListRequest): DescribeDistributeTableListResponse {
  var runtime = new $RuntimeOptions{};
  return describeDistributeTableListWithOptions(request, runtime);
}

model DescribeEventsRequest {
  endTime?: string(name='EndTime', example='2021-10-18T03:07:25Z'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='20'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  startTime?: string(name='StartTime', example='2021-10-18T03:07:25Z'),
}

model DescribeEventsResponseBody = {
  eventItems?: [ 
    {
      eventId?: long(name='EventId', example='50421290'),
      eventName?: string(name='EventName', example='ModifySecurityIps'),
      eventPayload?: string(name='EventPayload', example='{\\\\"Domain\\\\": \\\\"rds-cn-hangzhou.aliyuncs.com\\\\"}'),
      eventReason?: string(name='EventReason', example='FROM_USER'),
      eventRecordTime?: string(name='EventRecordTime', example='2021-10-15T06:39:49Z'),
      eventTime?: string(name='EventTime', example='2021-10-15T06:35:00Z'),
      eventType?: string(name='EventType', example='SecurityManagement'),
      eventUserType?: string(name='EventUserType', example='USRE'),
      regionId?: string(name='RegionId', example='cn-hangzhou'),
      resourceName?: string(name='ResourceName', example='px-bp1v8udesc89g156g'),
      resourceType?: string(name='ResourceType', example='instance'),
    }
  ](name='EventItems'),
  pageNumber?: long(name='PageNumber', example='1'),
  pageSize?: long(name='PageSize', example='20'),
  requestId?: string(name='RequestId', example='4748127A-6D50-432C-B635-433467074C27'),
  totalRecordCount?: long(name='TotalRecordCount', example='20'),
}

model DescribeEventsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeEventsResponseBody(name='body'),
}

/**
 * @summary 历史事件
 *
 * @param request DescribeEventsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeEventsResponse
 */
async function describeEventsWithOptions(request: DescribeEventsRequest, runtime: $RuntimeOptions): DescribeEventsResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeEvents',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 历史事件
 *
 * @param request DescribeEventsRequest
 * @return DescribeEventsResponse
 */
async function describeEvents(request: DescribeEventsRequest): DescribeEventsResponse {
  var runtime = new $RuntimeOptions{};
  return describeEventsWithOptions(request, runtime);
}

model DescribeGdnInstancesRequest {
  filterType?: string(name='FilterType', example='gdn_id、
polarx_id'),
  filterValue?: string(name='FilterValue', example='gdn-***、
pxc-***'),
  GDNId?: string(name='GDNId', description='GDN ID。', example='gdn-***'),
  pageNum?: string(name='PageNum', example='50'),
  pageSize?: string(name='PageSize', example='30'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model DescribeGdnInstancesResponseBody = {
  data?: {
    gdnInstanceList?: [ 
      {
        description?: string(name='Description', example='test'),
        gdnInstanceName?: string(name='GdnInstanceName', example='gdn-***'),
        gmtCreated?: string(name='GmtCreated', example='2025-01-02T13:11:10.000+0000'),
        memberList?: [ 
          {
            classCode?: string(name='ClassCode', example='polarx.x4.medium.2e'),
            cnNodeClassCode?: string(name='CnNodeClassCode', example='polarx.x4.medium.2e'),
            cnNodeCount?: string(name='CnNodeCount', example='2'),
            commodityCode?: string(name='CommodityCode', example='drds_polarxpre_public_cn'),
            dnNodeClassCode?: string(name='DnNodeClassCode', example='mysql.n4.medium.25'),
            dnNodeCount?: string(name='DnNodeCount', example='2'),
            expireTime?: string(name='ExpireTime', example='2025-01-02T13:11:10.000+0000'),
            gmtCreated?: string(name='GmtCreated', example='2025-01-02T13:11:10.000+0000'),
            memberName?: string(name='MemberName', example='pxc-***'),
            payType?: string(name='PayType', example='Prepaid'),
            primaryZone?: string(name='PrimaryZone', example='cn-zhangjiakou-a'),
            regionId?: string(name='RegionId', example='cn-hangzhou'),
            role?: string(name='Role', example='primary、
standby'),
            secondaryZone?: string(name='SecondaryZone', example='cn-zhangjiakou-a'),
            secondsBehindMaster?: string(name='SecondsBehindMaster', example='1s'),
            status?: string(name='Status', example='Creating'),
            taskStatus?: string(name='TaskStatus'),
            tertiaryZone?: string(name='TertiaryZone', example='cn-zhangjiakou-a'),
            zoneId?: string(name='ZoneId', example='cn-zhangjiakou-a'),
          }
        ](name='MemberList'),
        mysqlVersion?: string(name='MysqlVersion', example='5.7'),
        status?: string(name='Status', example='Creating'),
        switchHistory?: string(name='SwitchHistory', example='""'),
      }
    ](name='GdnInstanceList'),
    pageNumber?: string(name='PageNumber', example='1'),
    pageSize?: string(name='PageSize', example='30'),
    totalNumber?: string(name='TotalNumber', example='130'),
  }(name='Data'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='7B044BD1-6402-5DE9-9AED-63D15A994E37'),
  success?: boolean(name='Success', example='True'),
}

model DescribeGdnInstancesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeGdnInstancesResponseBody(name='body'),
}

/**
 * @summary 获取GDN实例列表
 *
 * @param request DescribeGdnInstancesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeGdnInstancesResponse
 */
async function describeGdnInstancesWithOptions(request: DescribeGdnInstancesRequest, runtime: $RuntimeOptions): DescribeGdnInstancesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.filterType)) {
    query['FilterType'] = request.filterType;
  }
  if (!$isNull(request.filterValue)) {
    query['FilterValue'] = request.filterValue;
  }
  if (!$isNull(request.GDNId)) {
    query['GDNId'] = request.GDNId;
  }
  if (!$isNull(request.pageNum)) {
    query['PageNum'] = request.pageNum;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeGdnInstances',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取GDN实例列表
 *
 * @param request DescribeGdnInstancesRequest
 * @return DescribeGdnInstancesResponse
 */
async function describeGdnInstances(request: DescribeGdnInstancesRequest): DescribeGdnInstancesResponse {
  var runtime = new $RuntimeOptions{};
  return describeGdnInstancesWithOptions(request, runtime);
}

model DescribeOpenBackupSetRequest {
  DBInstanceName?: string(name='DBInstanceName', description='This parameter is required.', example='pxc-********'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  restoreTime?: string(name='RestoreTime', example='2024-10-14T00:00:00Z'),
}

model DescribeOpenBackupSetResponseBody = {
  data?: any(name='Data', example='{"gmsBackupSet": {"pubFullDownloadUrl": "https://xxxxx","dnName": "pxc-xdb-m-xxxxxx","hostInstanceId": 0001,"binlogs": [],"backupEndTime": "2024-10-21T10:11:56Z","backupLinkExpiredTime": "2024-10-23T06:13:54Z","dnBackupSetId": "00088","notCompletedBinlogs": [],"commitIndex": "15249275","innerFullDownloadUrl": "http://xxxxx","backupStartTime": "2024-10-21T10:09:20Z","backupSetSize": 526118912},"dnBackupSets": [],"insName": "pxc-xxxxx","backupSetId": "cb-xxxxx","canBinlogRecoverToTime": 1729567925000,"backupEndTime": "2024-10-21T10:12:16Z","canBinlogRecoverToTimeUTC": "2024-10-22T03:32:05Z","canBackupMinRecoverToTimeUTC": "2024-10-21T10:11:56Z","pitrInvalid": false,"backupStartTime": "2024-10-21T10:09:16Z","canBackupMinRecoverToTime": 1729505516000}'),
  requestId?: string(name='RequestId', example='FEA5DC20-6D8A-5979-97AA-FC57546ADC20'),
}

model DescribeOpenBackupSetResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeOpenBackupSetResponseBody(name='body'),
}

/**
 * @summary 开放商业备份集
 *
 * @param request DescribeOpenBackupSetRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeOpenBackupSetResponse
 */
async function describeOpenBackupSetWithOptions(request: DescribeOpenBackupSetRequest, runtime: $RuntimeOptions): DescribeOpenBackupSetResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.DBInstanceName)) {
    query['DBInstanceName'] = request.DBInstanceName;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.restoreTime)) {
    query['RestoreTime'] = request.restoreTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeOpenBackupSet',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 开放商业备份集
 *
 * @param request DescribeOpenBackupSetRequest
 * @return DescribeOpenBackupSetResponse
 */
async function describeOpenBackupSet(request: DescribeOpenBackupSetRequest): DescribeOpenBackupSetResponse {
  var runtime = new $RuntimeOptions{};
  return describeOpenBackupSetWithOptions(request, runtime);
}

model DescribeParameterTemplatesRequest {
  DBInstanceId?: string(name='DBInstanceId', example='pxc-********'),
  engineVersion?: string(name='EngineVersion'),
  paramLevel?: string(name='ParamLevel', example='compute'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
}

model DescribeParameterTemplatesResponseBody = {
  data?: {
    engine?: string(name='Engine', example='polarx'),
    engineVersion?: string(name='EngineVersion', example='2.0'),
    parameterCount?: int32(name='ParameterCount', example='218'),
    parameters?: [ 
      {
        checkingCode?: string(name='CheckingCode', example='[0|1]'),
        dynamic?: int32(name='Dynamic', example='0'),
        parameterDescription?: string(name='ParameterDescription', example='polarx hatp addition param'),
        parameterName?: string(name='ParameterName', example='loose_enable_gts'),
        parameterValue?: string(name='ParameterValue', example='1'),
        revisable?: int32(name='Revisable', example='0'),
      }
    ](name='Parameters'),
  }(name='Data'),
  requestId?: string(name='RequestId', example='C458B1E8-1683-3645-B154-6BA32080EEA'),
}

model DescribeParameterTemplatesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeParameterTemplatesResponseBody(name='body'),
}

/**
 * @param request DescribeParameterTemplatesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeParameterTemplatesResponse
 */
async function describeParameterTemplatesWithOptions(request: DescribeParameterTemplatesRequest, runtime: $RuntimeOptions): DescribeParameterTemplatesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!$isNull(request.engineVersion)) {
    query['EngineVersion'] = request.engineVersion;
  }
  if (!$isNull(request.paramLevel)) {
    query['ParamLevel'] = request.paramLevel;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeParameterTemplates',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeParameterTemplatesRequest
 * @return DescribeParameterTemplatesResponse
 */
async function describeParameterTemplates(request: DescribeParameterTemplatesRequest): DescribeParameterTemplatesResponse {
  var runtime = new $RuntimeOptions{};
  return describeParameterTemplatesWithOptions(request, runtime);
}

model DescribeParametersRequest {
  DBInstanceId?: string(name='DBInstanceId', description='This parameter is required.', example='pxc-********'),
  paramLevel?: string(name='ParamLevel', example='compute'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
}

model DescribeParametersResponseBody = {
  data?: {
    configParameters?: [ 
      {
        parameterDescription?: string(name='ParameterDescription'),
        parameterName?: string(name='ParameterName', example='CONN_POOL_XPROTO_STORAGE_DB_PORT'),
        parameterValue?: string(name='ParameterValue', example='-1'),
      }
    ](name='ConfigParameters'),
    DBInstanceId?: string(name='DBInstanceId'),
    engine?: string(name='Engine', example='polarx'),
    engineVersion?: string(name='EngineVersion', example='2.0'),
    runningParameters?: [ 
      {
        parameterDescription?: string(name='ParameterDescription'),
        parameterName?: string(name='ParameterName', example='CONN_POOL_XPROTO_STORAGE_DB_PORT'),
        parameterValue?: string(name='ParameterValue', example='-1'),
      }
    ](name='RunningParameters'),
  }(name='Data'),
  requestId?: string(name='RequestId', example='6BA32080EEA'),
}

model DescribeParametersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeParametersResponseBody(name='body'),
}

/**
 * @param request DescribeParametersRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeParametersResponse
 */
async function describeParametersWithOptions(request: DescribeParametersRequest, runtime: $RuntimeOptions): DescribeParametersResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!$isNull(request.paramLevel)) {
    query['ParamLevel'] = request.paramLevel;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeParameters',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeParametersRequest
 * @return DescribeParametersResponse
 */
async function describeParameters(request: DescribeParametersRequest): DescribeParametersResponse {
  var runtime = new $RuntimeOptions{};
  return describeParametersWithOptions(request, runtime);
}

model DescribeRegionsResponseBody = {
  code?: int32(name='Code', example='200'),
  errorCode?: int32(name='ErrorCode', example='200'),
  message?: string(name='Message', example='success'),
  regions?: {
    region?: [ 
    {
      regionId?: string(name='RegionId', example='ch-hangzhou'),
      supportPolarx10?: boolean(name='SupportPolarx10', example='true'),
      supportPolarx20?: boolean(name='SupportPolarx20', example='true'),
      zones?: {
        zone?: [ 
        {
          vpcEnabled?: boolean(name='VpcEnabled', example='true'),
          zoneId?: string(name='ZoneId', example='cn-hangzhou-a'),
        }
      ](name='Zone')
      }(name='Zones'),
    }
  ](name='Region')
  }(name='Regions'),
  requestId?: string(name='RequestId', example='C458B1E8-1683-3645-B154-6BA32080EEA'),
  success?: boolean(name='Success', example='true'),
}

model DescribeRegionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeRegionsResponseBody(name='body'),
}

/**
 * @param request DescribeRegionsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeRegionsResponse
 */
async function describeRegionsWithOptions(runtime: $RuntimeOptions): DescribeRegionsResponse {
  var req = new OpenApiUtil.OpenApiRequest{};
  var params = new OpenApiUtil.Params{
    action = 'DescribeRegions',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @return DescribeRegionsResponse
 */
async function describeRegions(): DescribeRegionsResponse {
  var runtime = new $RuntimeOptions{};
  return describeRegionsWithOptions(runtime);
}

model DescribeScaleOutMigrateTaskListRequest {
  DBInstanceName?: string(name='DBInstanceName', description='This parameter is required.', example='pxc-********'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='This parameter is required.'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeScaleOutMigrateTaskListResponseBody = {
  progress?: int32(name='Progress', example='32'),
  requestId?: string(name='RequestId', example='C458B1E8-1683-3645-B154-6BA32080EEA'),
}

model DescribeScaleOutMigrateTaskListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeScaleOutMigrateTaskListResponseBody(name='body'),
}

/**
 * @param request DescribeScaleOutMigrateTaskListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeScaleOutMigrateTaskListResponse
 */
async function describeScaleOutMigrateTaskListWithOptions(request: DescribeScaleOutMigrateTaskListRequest, runtime: $RuntimeOptions): DescribeScaleOutMigrateTaskListResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.DBInstanceName)) {
    query['DBInstanceName'] = request.DBInstanceName;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeScaleOutMigrateTaskList',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeScaleOutMigrateTaskListRequest
 * @return DescribeScaleOutMigrateTaskListResponse
 */
async function describeScaleOutMigrateTaskList(request: DescribeScaleOutMigrateTaskListRequest): DescribeScaleOutMigrateTaskListResponse {
  var runtime = new $RuntimeOptions{};
  return describeScaleOutMigrateTaskListWithOptions(request, runtime);
}

model DescribeSecurityIpsRequest {
  DBInstanceName?: string(name='DBInstanceName', description='This parameter is required.', example='pxc-hzjasd****'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
}

model DescribeSecurityIpsResponseBody = {
  data?: {
    DBInstanceName?: string(name='DBInstanceName', example='pxc-hzjasd****'),
    groupItems?: [ 
      {
        groupName?: string(name='GroupName', example='defaultGroup'),
        securityIPList?: string(name='SecurityIPList', example='127.0.0.1,172.168.0.0'),
      }
    ](name='GroupItems'),
  }(name='Data'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='14036EBE-CF2E-44DB-ACE9-AC6157D3A6FC'),
  success?: boolean(name='Success', example='true'),
}

model DescribeSecurityIpsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSecurityIpsResponseBody(name='body'),
}

/**
 * @param request DescribeSecurityIpsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeSecurityIpsResponse
 */
async function describeSecurityIpsWithOptions(request: DescribeSecurityIpsRequest, runtime: $RuntimeOptions): DescribeSecurityIpsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.DBInstanceName)) {
    query['DBInstanceName'] = request.DBInstanceName;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeSecurityIps',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeSecurityIpsRequest
 * @return DescribeSecurityIpsResponse
 */
async function describeSecurityIps(request: DescribeSecurityIpsRequest): DescribeSecurityIpsResponse {
  var runtime = new $RuntimeOptions{};
  return describeSecurityIpsWithOptions(request, runtime);
}

model DescribeSlowLogRecordsRequest {
  characterType?: string(name='CharacterType', description='This parameter is required.', example='polarx_cn'),
  DBInstanceName?: string(name='DBInstanceName', description='This parameter is required.', example='pxc-bjxxxxxxxx'),
  DBName?: string(name='DBName', example='testdb'),
  DBNodeIds?: string(name='DBNodeIds', example='pxc-i-mezcj4ejdz'),
  endTime?: string(name='EndTime', description='This parameter is required.', example='2024-11-22T02:22Z'),
  page?: int32(name='Page', example='1'),
  pageSize?: int32(name='PageSize', example='30'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  startTime?: string(name='StartTime', description='This parameter is required.', example='2024-10-09T02:26'),
}

model DescribeSlowLogRecordsResponseBody = {
  DBInstanceId?: string(name='DBInstanceId', example='pxc-********'),
  items?: [ 
    {
      CNname?: string(name='CNname', example='pxc-i-xxxx'),
      DBName?: string(name='DBName', example='dcdev'),
      extension?: string(name='Extension', example='tddl:5.4.19-20240927'),
      fail?: string(name='Fail', example='0'),
      frows?: string(name='Frows', example='1'),
      hostAddress?: string(name='HostAddress', example='****[****] @ [1XX.XX.XX.XX]'),
      insName?: string(name='InsName', example='pxc-xdb-s-xxxx'),
      isBind?: string(name='IsBind', example='0'),
      lockTimeMS?: string(name='LockTimeMS', example='1'),
      params?: string(name='Params', example='["1"]'),
      parseRowCounts?: string(name='ParseRowCounts', example='10'),
      queryStartTime?: string(name='QueryStartTime', example='2024-11-22T02:22:22.444Z'),
      queryTime?: string(name='QueryTime', example='3.000'),
      queryTimeMS?: string(name='QueryTimeMS', example='3000.000'),
      returnRowCounts?: string(name='ReturnRowCounts', example='20'),
      rows?: string(name='Rows', example='1'),
      SCNT?: string(name='SCNT', example='1'),
      SQLHash?: string(name='SQLHash', example='c8df07e5d45cd68da8b4771c2016e20b'),
      SQLText?: string(name='SQLText', example='select * from test'),
      sqlType?: string(name='SqlType', example='select'),
      templateId?: string(name='TemplateId'),
      tooLong?: string(name='TooLong', example='0'),
      traceId?: string(name='TraceId', example='17a5c5c840006000'),
      transactionPolicy?: string(name='TransactionPolicy', example='XA'),
      trxId?: string(name='TrxId', example='17a5c5c840006000'),
      WT?: string(name='WT', example='TP'),
    }
  ](name='Items'),
  pageNumber?: string(name='PageNumber', example='1'),
  pageRecordCount?: string(name='PageRecordCount', example='30'),
  requestId?: string(name='RequestId', description='Id of the request', example='C458B1E8-1683-3645-B154-6BA32080EEA'),
  totalCount?: string(name='TotalCount', example='3'),
}

model DescribeSlowLogRecordsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSlowLogRecordsResponseBody(name='body'),
}

/**
 * @summary 慢SQL明细
 *
 * @param request DescribeSlowLogRecordsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeSlowLogRecordsResponse
 */
async function describeSlowLogRecordsWithOptions(request: DescribeSlowLogRecordsRequest, runtime: $RuntimeOptions): DescribeSlowLogRecordsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.characterType)) {
    query['CharacterType'] = request.characterType;
  }
  if (!$isNull(request.DBInstanceName)) {
    query['DBInstanceName'] = request.DBInstanceName;
  }
  if (!$isNull(request.DBName)) {
    query['DBName'] = request.DBName;
  }
  if (!$isNull(request.DBNodeIds)) {
    query['DBNodeIds'] = request.DBNodeIds;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.page)) {
    query['Page'] = request.page;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeSlowLogRecords',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 慢SQL明细
 *
 * @param request DescribeSlowLogRecordsRequest
 * @return DescribeSlowLogRecordsResponse
 */
async function describeSlowLogRecords(request: DescribeSlowLogRecordsRequest): DescribeSlowLogRecordsResponse {
  var runtime = new $RuntimeOptions{};
  return describeSlowLogRecordsWithOptions(request, runtime);
}

model DescribeTagsRequest {
  DBInstanceName?: string(name='DBInstanceName', example='pxc-xxx'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  tagKey?: string(name='TagKey', example='test'),
}

model DescribeTagsResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request', example='requestid'),
  tagInfos?: [ 
    {
      DBInstanceIds?: [ string ](name='DBInstanceIds'),
      tagKey?: string(name='TagKey', example='testKey'),
      tagValue?: string(name='TagValue', example='testValue'),
    }
  ](name='TagInfos'),
}

model DescribeTagsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeTagsResponseBody(name='body'),
}

/**
 * @summary 标签列表查询
 *
 * @param request DescribeTagsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeTagsResponse
 */
async function describeTagsWithOptions(request: DescribeTagsRequest, runtime: $RuntimeOptions): DescribeTagsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.DBInstanceName)) {
    query['DBInstanceName'] = request.DBInstanceName;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.tagKey)) {
    query['TagKey'] = request.tagKey;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeTags',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 标签列表查询
 *
 * @param request DescribeTagsRequest
 * @return DescribeTagsResponse
 */
async function describeTags(request: DescribeTagsRequest): DescribeTagsResponse {
  var runtime = new $RuntimeOptions{};
  return describeTagsWithOptions(request, runtime);
}

model DescribeTasksRequest {
  DBInstanceId?: string(name='DBInstanceId', description='This parameter is required.', example='pxc-hzjasd****'),
  endTime?: string(name='EndTime', description='This parameter is required.', example='2021-11-04'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', example='30'),
  pageSize?: int32(name='PageSize'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  startTime?: string(name='StartTime', description='This parameter is required.', example='2021-11-01'),
}

model DescribeTasksResponseBody = {
  items?: [ 
    {
      beginTime?: string(name='BeginTime', example='2021-10-20T19:40:00Z'),
      DBName?: string(name='DBName', example='DBName'),
      finishTime?: string(name='FinishTime', example='2021-10-20T20:00:00Z'),
      progress?: string(name='Progress', example='80'),
      progressInfo?: string(name='ProgressInfo', example='ProgressInfo'),
      scaleOutToken?: string(name='ScaleOutToken', example='FEA5DC20-6D8A-5979-97AA-FC57546ADC20'),
      status?: string(name='Status', example='RUNNING'),
      taskAction?: string(name='TaskAction', example='multi_scale_out'),
      taskErrorCode?: string(name='TaskErrorCode', example='TaskErrorCode'),
      taskErrorMessage?: string(name='TaskErrorMessage', example='TaskErrorMessage'),
      taskId?: string(name='TaskId', example='20089398'),
    }
  ](name='Items'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageRecordCount?: int32(name='PageRecordCount', example='30'),
  requestId?: string(name='RequestId', example='D6045D78-C119-5A17-9DEA-0F810394E008'),
  totalRecordCount?: int32(name='TotalRecordCount', example='2'),
}

model DescribeTasksResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeTasksResponseBody(name='body'),
}

/**
 * @param request DescribeTasksRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeTasksResponse
 */
async function describeTasksWithOptions(request: DescribeTasksRequest, runtime: $RuntimeOptions): DescribeTasksResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!$isNull(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!$isNull(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!$isNull(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeTasks',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeTasksRequest
 * @return DescribeTasksResponse
 */
async function describeTasks(request: DescribeTasksRequest): DescribeTasksResponse {
  var runtime = new $RuntimeOptions{};
  return describeTasksWithOptions(request, runtime);
}

model DescribeUserEncryptionKeyListRequest {
  DBInstanceName?: string(name='DBInstanceName', example='pxc-hzjasd****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model DescribeUserEncryptionKeyListResponseBody = {
  data?: {
    keyIds?: [ string ](name='KeyIds'),
  }(name='Data'),
  requestId?: string(name='RequestId', example='FEA5DC20-6D8A-5979-97AA-FC57546ADC20'),
}

model DescribeUserEncryptionKeyListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeUserEncryptionKeyListResponseBody(name='body'),
}

/**
 * @param request DescribeUserEncryptionKeyListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeUserEncryptionKeyListResponse
 */
async function describeUserEncryptionKeyListWithOptions(request: DescribeUserEncryptionKeyListRequest, runtime: $RuntimeOptions): DescribeUserEncryptionKeyListResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.DBInstanceName)) {
    query['DBInstanceName'] = request.DBInstanceName;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeUserEncryptionKeyList',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeUserEncryptionKeyListRequest
 * @return DescribeUserEncryptionKeyListResponse
 */
async function describeUserEncryptionKeyList(request: DescribeUserEncryptionKeyListRequest): DescribeUserEncryptionKeyListResponse {
  var runtime = new $RuntimeOptions{};
  return describeUserEncryptionKeyListWithOptions(request, runtime);
}

model DisableRightsSeparationRequest {
  DBInstanceName?: string(name='DBInstanceName', description='This parameter is required.', example='pxc-sprcym7g7w****'),
  dbaAccountName?: string(name='DbaAccountName', description='This parameter is required.', example='account_1'),
  dbaAccountPassword?: string(name='DbaAccountPassword', description='This parameter is required.', example='*****'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hanghzou'),
}

model DisableRightsSeparationResponseBody = {
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='FE5D94E3-3C93-3594-95D9-AAED2A980915'),
  success?: boolean(name='Success', example='true'),
}

model DisableRightsSeparationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DisableRightsSeparationResponseBody(name='body'),
}

/**
 * @param request DisableRightsSeparationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DisableRightsSeparationResponse
 */
async function disableRightsSeparationWithOptions(request: DisableRightsSeparationRequest, runtime: $RuntimeOptions): DisableRightsSeparationResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.DBInstanceName)) {
    query['DBInstanceName'] = request.DBInstanceName;
  }
  if (!$isNull(request.dbaAccountName)) {
    query['DbaAccountName'] = request.dbaAccountName;
  }
  if (!$isNull(request.dbaAccountPassword)) {
    query['DbaAccountPassword'] = request.dbaAccountPassword;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DisableRightsSeparation',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DisableRightsSeparationRequest
 * @return DisableRightsSeparationResponse
 */
async function disableRightsSeparation(request: DisableRightsSeparationRequest): DisableRightsSeparationResponse {
  var runtime = new $RuntimeOptions{};
  return disableRightsSeparationWithOptions(request, runtime);
}

model EnableRightsSeparationRequest {
  auditAccountDescription?: string(name='AuditAccountDescription', example='test123'),
  auditAccountName?: string(name='AuditAccountName', description='This parameter is required.', example='account_audit'),
  auditAccountPassword?: string(name='AuditAccountPassword', description='This parameter is required.', example='******'),
  DBInstanceName?: string(name='DBInstanceName', description='This parameter is required.', example='pxc-htri0ori2r4k9p'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  securityAccountDescription?: string(name='SecurityAccountDescription', example='test123'),
  securityAccountName?: string(name='SecurityAccountName', description='This parameter is required.', example='account_sec'),
  securityAccountPassword?: string(name='SecurityAccountPassword', description='This parameter is required.', example='*****'),
}

model EnableRightsSeparationResponseBody = {
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='73559800-3c8c-11ec-bd40-99cfcff3fe1e'),
  success?: boolean(name='Success', example='true'),
}

model EnableRightsSeparationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: EnableRightsSeparationResponseBody(name='body'),
}

/**
 * @summary 开启三权分立
 *
 * @param request EnableRightsSeparationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return EnableRightsSeparationResponse
 */
async function enableRightsSeparationWithOptions(request: EnableRightsSeparationRequest, runtime: $RuntimeOptions): EnableRightsSeparationResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.auditAccountDescription)) {
    query['AuditAccountDescription'] = request.auditAccountDescription;
  }
  if (!$isNull(request.auditAccountName)) {
    query['AuditAccountName'] = request.auditAccountName;
  }
  if (!$isNull(request.auditAccountPassword)) {
    query['AuditAccountPassword'] = request.auditAccountPassword;
  }
  if (!$isNull(request.DBInstanceName)) {
    query['DBInstanceName'] = request.DBInstanceName;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.securityAccountDescription)) {
    query['SecurityAccountDescription'] = request.securityAccountDescription;
  }
  if (!$isNull(request.securityAccountName)) {
    query['SecurityAccountName'] = request.securityAccountName;
  }
  if (!$isNull(request.securityAccountPassword)) {
    query['SecurityAccountPassword'] = request.securityAccountPassword;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'EnableRightsSeparation',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 开启三权分立
 *
 * @param request EnableRightsSeparationRequest
 * @return EnableRightsSeparationResponse
 */
async function enableRightsSeparation(request: EnableRightsSeparationRequest): EnableRightsSeparationResponse {
  var runtime = new $RuntimeOptions{};
  return enableRightsSeparationWithOptions(request, runtime);
}

model ListTagResourcesRequest {
  nextToken?: string(name='NextToken', example='xxdds'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  resourceId?: [ string ](name='ResourceId'),
  resourceType?: string(name='ResourceType', description='This parameter is required.', example='PolarDBXInstance'),
  tag?: [ 
    {
      key?: string(name='Key', example='1'),
      value?: string(name='Value', example='2'),
    }
  ](name='Tag'),
}

model ListTagResourcesResponseBody = {
  nextToken?: string(name='NextToken', example='xxdd'),
  requestId?: string(name='RequestId', example='xxxx-xxxxxx'),
  tagResources?: {
    tagResource?: [ 
    {
      resourceId?: string(name='ResourceId', example='pxc-xxxx'),
      resourceType?: string(name='ResourceType', example='PolarDBXInstance'),
      tagKey?: string(name='TagKey', example='1'),
      tagValue?: string(name='TagValue', example='1'),
    }
  ](name='TagResource')
  }(name='TagResources'),
}

model ListTagResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTagResourcesResponseBody(name='body'),
}

/**
 * @summary 查标签接口
 *
 * @param request ListTagResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTagResourcesResponse
 */
async function listTagResourcesWithOptions(request: ListTagResourcesRequest, runtime: $RuntimeOptions): ListTagResourcesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!$isNull(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!$isNull(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListTagResources',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查标签接口
 *
 * @param request ListTagResourcesRequest
 * @return ListTagResourcesResponse
 */
async function listTagResources(request: ListTagResourcesRequest): ListTagResourcesResponse {
  var runtime = new $RuntimeOptions{};
  return listTagResourcesWithOptions(request, runtime);
}

model ModifyAccountDescriptionRequest {
  accountDescription?: string(name='AccountDescription'),
  accountName?: string(name='AccountName', description='This parameter is required.', example='account'),
  DBInstanceName?: string(name='DBInstanceName', description='This parameter is required.', example='pxc-hzjasd****'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
}

model ModifyAccountDescriptionResponseBody = {
  message?: string(name='Message', example='msg'),
  requestId?: string(name='RequestId', example='FEA5DC20-6D8A-5979-97AA-FC57546ADC20'),
  success?: boolean(name='Success', example='true'),
}

model ModifyAccountDescriptionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyAccountDescriptionResponseBody(name='body'),
}

/**
 * @param request ModifyAccountDescriptionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyAccountDescriptionResponse
 */
async function modifyAccountDescriptionWithOptions(request: ModifyAccountDescriptionRequest, runtime: $RuntimeOptions): ModifyAccountDescriptionResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.accountDescription)) {
    query['AccountDescription'] = request.accountDescription;
  }
  if (!$isNull(request.accountName)) {
    query['AccountName'] = request.accountName;
  }
  if (!$isNull(request.DBInstanceName)) {
    query['DBInstanceName'] = request.DBInstanceName;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifyAccountDescription',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ModifyAccountDescriptionRequest
 * @return ModifyAccountDescriptionResponse
 */
async function modifyAccountDescription(request: ModifyAccountDescriptionRequest): ModifyAccountDescriptionResponse {
  var runtime = new $RuntimeOptions{};
  return modifyAccountDescriptionWithOptions(request, runtime);
}

model ModifyAccountPrivilegeRequest {
  accountName?: string(name='AccountName', description='This parameter is required.', example='account_sec'),
  accountPrivilege?: string(name='AccountPrivilege', example='ReadWrite'),
  DBInstanceName?: string(name='DBInstanceName', description='This parameter is required.', example='pxc-htri0ori2r4k9p'),
  dbName?: string(name='DbName', example='sbtest'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  securityAccountName?: string(name='SecurityAccountName', example='account_audit'),
  securityAccountPassword?: string(name='SecurityAccountPassword', example='*****'),
}

model ModifyAccountPrivilegeResponseBody = {
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='73559800-3c8c-11ec-bd40-99cfcff3fe1e'),
  success?: boolean(name='Success', example='true'),
}

model ModifyAccountPrivilegeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyAccountPrivilegeResponseBody(name='body'),
}

/**
 * @param request ModifyAccountPrivilegeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyAccountPrivilegeResponse
 */
async function modifyAccountPrivilegeWithOptions(request: ModifyAccountPrivilegeRequest, runtime: $RuntimeOptions): ModifyAccountPrivilegeResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.accountName)) {
    query['AccountName'] = request.accountName;
  }
  if (!$isNull(request.accountPrivilege)) {
    query['AccountPrivilege'] = request.accountPrivilege;
  }
  if (!$isNull(request.DBInstanceName)) {
    query['DBInstanceName'] = request.DBInstanceName;
  }
  if (!$isNull(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.securityAccountName)) {
    query['SecurityAccountName'] = request.securityAccountName;
  }
  if (!$isNull(request.securityAccountPassword)) {
    query['SecurityAccountPassword'] = request.securityAccountPassword;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifyAccountPrivilege',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ModifyAccountPrivilegeRequest
 * @return ModifyAccountPrivilegeResponse
 */
async function modifyAccountPrivilege(request: ModifyAccountPrivilegeRequest): ModifyAccountPrivilegeResponse {
  var runtime = new $RuntimeOptions{};
  return modifyAccountPrivilegeWithOptions(request, runtime);
}

model ModifyActiveOperationMaintainConfRequest {
  cycleTime?: string(name='CycleTime', description='This parameter is required.', example='1,2,3,4,5,6,7'),
  cycleType?: string(name='CycleType', description='This parameter is required.', example='Week'),
  maintainEndTime?: string(name='MaintainEndTime', description='This parameter is required.', example='02:00:00Z'),
  maintainStartTime?: string(name='MaintainStartTime', description='This parameter is required.', example='02:00:00Z'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  status?: int32(name='Status', description='This parameter is required.', example='1'),
}

model ModifyActiveOperationMaintainConfResponseBody = {
  requestId?: string(name='RequestId', example='4035409E-7297-4115-ABC9-C1C3942BC069'),
}

model ModifyActiveOperationMaintainConfResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyActiveOperationMaintainConfResponseBody(name='body'),
}

/**
 * @summary 修改全局运维窗口信息
 *
 * @param request ModifyActiveOperationMaintainConfRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyActiveOperationMaintainConfResponse
 */
async function modifyActiveOperationMaintainConfWithOptions(request: ModifyActiveOperationMaintainConfRequest, runtime: $RuntimeOptions): ModifyActiveOperationMaintainConfResponse {
  request.validate();
  var query = OpenApiUtil.query(request.toMap());
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifyActiveOperationMaintainConf',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 修改全局运维窗口信息
 *
 * @param request ModifyActiveOperationMaintainConfRequest
 * @return ModifyActiveOperationMaintainConfResponse
 */
async function modifyActiveOperationMaintainConf(request: ModifyActiveOperationMaintainConfRequest): ModifyActiveOperationMaintainConfResponse {
  var runtime = new $RuntimeOptions{};
  return modifyActiveOperationMaintainConfWithOptions(request, runtime);
}

model ModifyActiveOperationTasksRequest {
  ids?: string(name='Ids', description='This parameter is required.', example='1'),
  immediateStart?: long(name='ImmediateStart', example='1'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  switchTime?: string(name='SwitchTime', example='2021-08-15T12:00:00Z'),
}

model ModifyActiveOperationTasksResponseBody = {
  ids?: string(name='Ids', example='1'),
  requestId?: string(name='RequestId', example='8C9CC90A-9532-4752-B59F-580112C5A45B'),
}

model ModifyActiveOperationTasksResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyActiveOperationTasksResponseBody(name='body'),
}

/**
 * @summary 修改主动运维任务
 *
 * @param request ModifyActiveOperationTasksRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyActiveOperationTasksResponse
 */
async function modifyActiveOperationTasksWithOptions(request: ModifyActiveOperationTasksRequest, runtime: $RuntimeOptions): ModifyActiveOperationTasksResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.ids)) {
    query['Ids'] = request.ids;
  }
  if (!$isNull(request.immediateStart)) {
    query['ImmediateStart'] = request.immediateStart;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.switchTime)) {
    query['SwitchTime'] = request.switchTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifyActiveOperationTasks',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 修改主动运维任务
 *
 * @param request ModifyActiveOperationTasksRequest
 * @return ModifyActiveOperationTasksResponse
 */
async function modifyActiveOperationTasks(request: ModifyActiveOperationTasksRequest): ModifyActiveOperationTasksResponse {
  var runtime = new $RuntimeOptions{};
  return modifyActiveOperationTasksWithOptions(request, runtime);
}

model ModifyDBInstanceClassRequest {
  clientToken?: string(name='ClientToken', example='FEA5DC20-6D8A-5979-97AA-FC57546ADC20'),
  cnClass?: string(name='CnClass'),
  DBInstanceName?: string(name='DBInstanceName', description='This parameter is required.', example='pxc-hzjasd****'),
  dnClass?: string(name='DnClass'),
  dnStorageSpace?: string(name='DnStorageSpace'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  specifiedDNScale?: boolean(name='SpecifiedDNScale'),
  specifiedDNSpecMapJson?: string(name='SpecifiedDNSpecMapJson'),
  switchTime?: string(name='SwitchTime'),
  switchTimeMode?: string(name='SwitchTimeMode'),
  targetDBInstanceClass?: string(name='TargetDBInstanceClass', example='polarx.x4.xlarge.2e'),
}

model ModifyDBInstanceClassResponseBody = {
  orderId?: string(name='OrderId', example='20211103105558'),
  requestId?: string(name='RequestId', example='FEA5DC20-6D8A-5979-97AA-FC57546ADC20'),
}

model ModifyDBInstanceClassResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyDBInstanceClassResponseBody(name='body'),
}

/**
 * @param request ModifyDBInstanceClassRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyDBInstanceClassResponse
 */
async function modifyDBInstanceClassWithOptions(request: ModifyDBInstanceClassRequest, runtime: $RuntimeOptions): ModifyDBInstanceClassResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.cnClass)) {
    query['CnClass'] = request.cnClass;
  }
  if (!$isNull(request.DBInstanceName)) {
    query['DBInstanceName'] = request.DBInstanceName;
  }
  if (!$isNull(request.dnClass)) {
    query['DnClass'] = request.dnClass;
  }
  if (!$isNull(request.dnStorageSpace)) {
    query['DnStorageSpace'] = request.dnStorageSpace;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.specifiedDNScale)) {
    query['SpecifiedDNScale'] = request.specifiedDNScale;
  }
  if (!$isNull(request.specifiedDNSpecMapJson)) {
    query['SpecifiedDNSpecMapJson'] = request.specifiedDNSpecMapJson;
  }
  if (!$isNull(request.switchTime)) {
    query['SwitchTime'] = request.switchTime;
  }
  if (!$isNull(request.switchTimeMode)) {
    query['SwitchTimeMode'] = request.switchTimeMode;
  }
  if (!$isNull(request.targetDBInstanceClass)) {
    query['TargetDBInstanceClass'] = request.targetDBInstanceClass;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifyDBInstanceClass',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ModifyDBInstanceClassRequest
 * @return ModifyDBInstanceClassResponse
 */
async function modifyDBInstanceClass(request: ModifyDBInstanceClassRequest): ModifyDBInstanceClassResponse {
  var runtime = new $RuntimeOptions{};
  return modifyDBInstanceClassWithOptions(request, runtime);
}

model ModifyDBInstanceConfigRequest {
  configName?: string(name='ConfigName', description='This parameter is required.', example='ENABLE_CONSISTENT_REPLICA_READ'),
  configValue?: string(name='ConfigValue', description='This parameter is required.', example='true'),
  DBInstanceName?: string(name='DBInstanceName', description='This parameter is required.', example='pxc-hzjasd****'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
}

model ModifyDBInstanceConfigResponseBody = {
  requestId?: string(name='RequestId', example='FEA5DC20-6D8A-5979-97AA-FC57546ADC20'),
}

model ModifyDBInstanceConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyDBInstanceConfigResponseBody(name='body'),
}

/**
 * @summary 修改实例配置
 *
 * @param request ModifyDBInstanceConfigRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyDBInstanceConfigResponse
 */
async function modifyDBInstanceConfigWithOptions(request: ModifyDBInstanceConfigRequest, runtime: $RuntimeOptions): ModifyDBInstanceConfigResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.configName)) {
    query['ConfigName'] = request.configName;
  }
  if (!$isNull(request.configValue)) {
    query['ConfigValue'] = request.configValue;
  }
  if (!$isNull(request.DBInstanceName)) {
    query['DBInstanceName'] = request.DBInstanceName;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifyDBInstanceConfig',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 修改实例配置
 *
 * @param request ModifyDBInstanceConfigRequest
 * @return ModifyDBInstanceConfigResponse
 */
async function modifyDBInstanceConfig(request: ModifyDBInstanceConfigRequest): ModifyDBInstanceConfigResponse {
  var runtime = new $RuntimeOptions{};
  return modifyDBInstanceConfigWithOptions(request, runtime);
}

model ModifyDBInstanceConnectionStringRequest {
  connectionString?: string(name='ConnectionString', description='This parameter is required.', example='pxc-unrf5ssig0ecg8.polarx.huhehaote.rds.aliyuncs.com'),
  DBInstanceName?: string(name='DBInstanceName', description='This parameter is required.', example='pxc-unrf5ssig0ecg8'),
  newPort?: string(name='NewPort', description='This parameter is required.', example='3300'),
  newPrefix?: string(name='NewPrefix', description='This parameter is required.', example='test2'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
}

model ModifyDBInstanceConnectionStringResponseBody = {
  code?: long(name='Code', example='200'),
  data?: {
    connectionString?: string(name='ConnectionString', example='test2.polarx.huhehaote.rds.aliyuncs.com'),
    DBInstanceName?: string(name='DBInstanceName', example='pxc-unrf5ssig0ecg8'),
    DBInstanceNetType?: string(name='DBInstanceNetType', example='1'),
    port?: string(name='Port', example='3300'),
  }(name='Data'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='c3cf535c-a585-11ea-8263-00163e04d3a7'),
}

model ModifyDBInstanceConnectionStringResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyDBInstanceConnectionStringResponseBody(name='body'),
}

/**
 * @summary 修改实例链接串
 *
 * @param request ModifyDBInstanceConnectionStringRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyDBInstanceConnectionStringResponse
 */
async function modifyDBInstanceConnectionStringWithOptions(request: ModifyDBInstanceConnectionStringRequest, runtime: $RuntimeOptions): ModifyDBInstanceConnectionStringResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.connectionString)) {
    query['ConnectionString'] = request.connectionString;
  }
  if (!$isNull(request.DBInstanceName)) {
    query['DBInstanceName'] = request.DBInstanceName;
  }
  if (!$isNull(request.newPort)) {
    query['NewPort'] = request.newPort;
  }
  if (!$isNull(request.newPrefix)) {
    query['NewPrefix'] = request.newPrefix;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifyDBInstanceConnectionString',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 修改实例链接串
 *
 * @param request ModifyDBInstanceConnectionStringRequest
 * @return ModifyDBInstanceConnectionStringResponse
 */
async function modifyDBInstanceConnectionString(request: ModifyDBInstanceConnectionStringRequest): ModifyDBInstanceConnectionStringResponse {
  var runtime = new $RuntimeOptions{};
  return modifyDBInstanceConnectionStringWithOptions(request, runtime);
}

model ModifyDBInstanceDescriptionRequest {
  DBInstanceDescription?: string(name='DBInstanceDescription', description='This parameter is required.'),
  DBInstanceName?: string(name='DBInstanceName', description='This parameter is required.', example='pxc-hzjasd****'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
}

model ModifyDBInstanceDescriptionResponseBody = {
  requestId?: string(name='RequestId', example='FEA5DC20-6D8A-5979-97AA-FC57546ADC20'),
}

model ModifyDBInstanceDescriptionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyDBInstanceDescriptionResponseBody(name='body'),
}

/**
 * @param request ModifyDBInstanceDescriptionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyDBInstanceDescriptionResponse
 */
async function modifyDBInstanceDescriptionWithOptions(request: ModifyDBInstanceDescriptionRequest, runtime: $RuntimeOptions): ModifyDBInstanceDescriptionResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.DBInstanceDescription)) {
    query['DBInstanceDescription'] = request.DBInstanceDescription;
  }
  if (!$isNull(request.DBInstanceName)) {
    query['DBInstanceName'] = request.DBInstanceName;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifyDBInstanceDescription',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ModifyDBInstanceDescriptionRequest
 * @return ModifyDBInstanceDescriptionResponse
 */
async function modifyDBInstanceDescription(request: ModifyDBInstanceDescriptionRequest): ModifyDBInstanceDescriptionResponse {
  var runtime = new $RuntimeOptions{};
  return modifyDBInstanceDescriptionWithOptions(request, runtime);
}

model ModifyDatabaseDescriptionRequest {
  DBInstanceName?: string(name='DBInstanceName', description='This parameter is required.', example='pxc-hzjasd****'),
  dbDescription?: string(name='DbDescription', description='This parameter is required.'),
  dbName?: string(name='DbName', description='This parameter is required.', example='testDB'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
}

model ModifyDatabaseDescriptionResponseBody = {
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='FEA5DC20-6D8A-5979-97AA-FC57546ADC20'),
  success?: boolean(name='Success', example='true'),
}

model ModifyDatabaseDescriptionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyDatabaseDescriptionResponseBody(name='body'),
}

/**
 * @param request ModifyDatabaseDescriptionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyDatabaseDescriptionResponse
 */
async function modifyDatabaseDescriptionWithOptions(request: ModifyDatabaseDescriptionRequest, runtime: $RuntimeOptions): ModifyDatabaseDescriptionResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.DBInstanceName)) {
    query['DBInstanceName'] = request.DBInstanceName;
  }
  if (!$isNull(request.dbDescription)) {
    query['DbDescription'] = request.dbDescription;
  }
  if (!$isNull(request.dbName)) {
    query['DbName'] = request.dbName;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifyDatabaseDescription',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ModifyDatabaseDescriptionRequest
 * @return ModifyDatabaseDescriptionResponse
 */
async function modifyDatabaseDescription(request: ModifyDatabaseDescriptionRequest): ModifyDatabaseDescriptionResponse {
  var runtime = new $RuntimeOptions{};
  return modifyDatabaseDescriptionWithOptions(request, runtime);
}

model ModifyParameterRequest {
  clientToken?: string(name='ClientToken', example='FEA5DC20-6D8A-5979-97AA-FC57546ADC20'),
  DBInstanceId?: string(name='DBInstanceId', description='This parameter is required.', example='pxc-hzjasdyuoo'),
  paramLevel?: string(name='ParamLevel', example='compute'),
  parameterGroupId?: string(name='ParameterGroupId'),
  parameters?: string(name='Parameters', example='{"CONN_POOL_BLOCK_TIMEOUT":6000}'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
}

model ModifyParameterResponseBody = {
  requestId?: string(name='RequestId', example='FEA5DC20-6D8A-5979-97AA-FC57546ADC20'),
}

model ModifyParameterResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyParameterResponseBody(name='body'),
}

/**
 * @param request ModifyParameterRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyParameterResponse
 */
async function modifyParameterWithOptions(request: ModifyParameterRequest, runtime: $RuntimeOptions): ModifyParameterResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!$isNull(request.paramLevel)) {
    query['ParamLevel'] = request.paramLevel;
  }
  if (!$isNull(request.parameterGroupId)) {
    query['ParameterGroupId'] = request.parameterGroupId;
  }
  if (!$isNull(request.parameters)) {
    query['Parameters'] = request.parameters;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifyParameter',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ModifyParameterRequest
 * @return ModifyParameterResponse
 */
async function modifyParameter(request: ModifyParameterRequest): ModifyParameterResponse {
  var runtime = new $RuntimeOptions{};
  return modifyParameterWithOptions(request, runtime);
}

model ModifySecurityIpsRequest {
  DBInstanceName?: string(name='DBInstanceName', description='This parameter is required.', example='pxc-hzjasd****'),
  groupName?: string(name='GroupName', example='default'),
  modifyMode?: string(name='ModifyMode', example='1'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  securityIPList?: string(name='SecurityIPList', description='This parameter is required.', example='127.0.0.1,192.168.0.0'),
}

model ModifySecurityIpsResponseBody = {
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='FEA5DC20-6D8A-5979-97AA-FC57546ADC20'),
  success?: boolean(name='Success', example='true'),
}

model ModifySecurityIpsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifySecurityIpsResponseBody(name='body'),
}

/**
 * @param request ModifySecurityIpsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifySecurityIpsResponse
 */
async function modifySecurityIpsWithOptions(request: ModifySecurityIpsRequest, runtime: $RuntimeOptions): ModifySecurityIpsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.DBInstanceName)) {
    query['DBInstanceName'] = request.DBInstanceName;
  }
  if (!$isNull(request.groupName)) {
    query['GroupName'] = request.groupName;
  }
  if (!$isNull(request.modifyMode)) {
    query['ModifyMode'] = request.modifyMode;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.securityIPList)) {
    query['SecurityIPList'] = request.securityIPList;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifySecurityIps',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ModifySecurityIpsRequest
 * @return ModifySecurityIpsResponse
 */
async function modifySecurityIps(request: ModifySecurityIpsRequest): ModifySecurityIpsResponse {
  var runtime = new $RuntimeOptions{};
  return modifySecurityIpsWithOptions(request, runtime);
}

model ReleaseColdDataVolumeRequest {
  DBInstanceName?: string(name='DBInstanceName', description='This parameter is required.', example='pxc-hzravgpt8q****'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
}

model ReleaseColdDataVolumeResponseBody = {
  requestId?: string(name='RequestId', example='EA330983-C895-57C0-AE82-5A63106EBB10'),
}

model ReleaseColdDataVolumeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ReleaseColdDataVolumeResponseBody(name='body'),
}

/**
 * @summary 关闭冷存储
 *
 * @param request ReleaseColdDataVolumeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ReleaseColdDataVolumeResponse
 */
async function releaseColdDataVolumeWithOptions(request: ReleaseColdDataVolumeRequest, runtime: $RuntimeOptions): ReleaseColdDataVolumeResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.DBInstanceName)) {
    query['DBInstanceName'] = request.DBInstanceName;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ReleaseColdDataVolume',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 关闭冷存储
 *
 * @param request ReleaseColdDataVolumeRequest
 * @return ReleaseColdDataVolumeResponse
 */
async function releaseColdDataVolume(request: ReleaseColdDataVolumeRequest): ReleaseColdDataVolumeResponse {
  var runtime = new $RuntimeOptions{};
  return releaseColdDataVolumeWithOptions(request, runtime);
}

model ReleaseInstancePublicConnectionRequest {
  currentConnectionString?: string(name='CurrentConnectionString', description='This parameter is required.', example='pxc-hzjasdyuoo.polarx.rds.aliyuncs.com'),
  DBInstanceName?: string(name='DBInstanceName', description='This parameter is required.', example='pxc-hzjasd****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model ReleaseInstancePublicConnectionResponseBody = {
  requestId?: string(name='RequestId', example='FEA5DC20-6D8A-5979-97AA-FC57546ADC20'),
}

model ReleaseInstancePublicConnectionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ReleaseInstancePublicConnectionResponseBody(name='body'),
}

/**
 * @param request ReleaseInstancePublicConnectionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ReleaseInstancePublicConnectionResponse
 */
async function releaseInstancePublicConnectionWithOptions(request: ReleaseInstancePublicConnectionRequest, runtime: $RuntimeOptions): ReleaseInstancePublicConnectionResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.currentConnectionString)) {
    query['CurrentConnectionString'] = request.currentConnectionString;
  }
  if (!$isNull(request.DBInstanceName)) {
    query['DBInstanceName'] = request.DBInstanceName;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ReleaseInstancePublicConnection',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ReleaseInstancePublicConnectionRequest
 * @return ReleaseInstancePublicConnectionResponse
 */
async function releaseInstancePublicConnection(request: ReleaseInstancePublicConnectionRequest): ReleaseInstancePublicConnectionResponse {
  var runtime = new $RuntimeOptions{};
  return releaseInstancePublicConnectionWithOptions(request, runtime);
}

model ResetAccountPasswordRequest {
  accountName?: string(name='AccountName', description='This parameter is required.', example='account'),
  accountPassword?: string(name='AccountPassword', description='This parameter is required.', example='*****'),
  DBInstanceName?: string(name='DBInstanceName', description='This parameter is required.', example='pxc-htri0ori2r4k9p'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  securityAccountName?: string(name='SecurityAccountName', example='account_sec'),
  securityAccountPassword?: string(name='SecurityAccountPassword', example='*****'),
}

model ResetAccountPasswordResponseBody = {
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='73559800-3c8c-11ec-bd40-99cfcff3fe1e'),
  success?: boolean(name='Success', example='true'),
}

model ResetAccountPasswordResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ResetAccountPasswordResponseBody(name='body'),
}

/**
 * @param request ResetAccountPasswordRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ResetAccountPasswordResponse
 */
async function resetAccountPasswordWithOptions(request: ResetAccountPasswordRequest, runtime: $RuntimeOptions): ResetAccountPasswordResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.accountName)) {
    query['AccountName'] = request.accountName;
  }
  if (!$isNull(request.accountPassword)) {
    query['AccountPassword'] = request.accountPassword;
  }
  if (!$isNull(request.DBInstanceName)) {
    query['DBInstanceName'] = request.DBInstanceName;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.securityAccountName)) {
    query['SecurityAccountName'] = request.securityAccountName;
  }
  if (!$isNull(request.securityAccountPassword)) {
    query['SecurityAccountPassword'] = request.securityAccountPassword;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ResetAccountPassword',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ResetAccountPasswordRequest
 * @return ResetAccountPasswordResponse
 */
async function resetAccountPassword(request: ResetAccountPasswordRequest): ResetAccountPasswordResponse {
  var runtime = new $RuntimeOptions{};
  return resetAccountPasswordWithOptions(request, runtime);
}

model RestartDBInstanceRequest {
  DBInstanceName?: string(name='DBInstanceName', description='This parameter is required.', example='pxc-hzjasd****'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
}

model RestartDBInstanceResponseBody = {
  requestId?: string(name='RequestId', example='FEA5DC20-6D8A-5979-97AA-FC57546ADC20'),
}

model RestartDBInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RestartDBInstanceResponseBody(name='body'),
}

/**
 * @param request RestartDBInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RestartDBInstanceResponse
 */
async function restartDBInstanceWithOptions(request: RestartDBInstanceRequest, runtime: $RuntimeOptions): RestartDBInstanceResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.DBInstanceName)) {
    query['DBInstanceName'] = request.DBInstanceName;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'RestartDBInstance',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request RestartDBInstanceRequest
 * @return RestartDBInstanceResponse
 */
async function restartDBInstance(request: RestartDBInstanceRequest): RestartDBInstanceResponse {
  var runtime = new $RuntimeOptions{};
  return restartDBInstanceWithOptions(request, runtime);
}

model SwitchDBInstanceHARequest {
  DBInstanceName?: string(name='DBInstanceName', description='This parameter is required.'),
  regionId?: string(name='RegionId', description='This parameter is required.'),
  switchTime?: string(name='SwitchTime'),
  switchTimeMode?: string(name='SwitchTimeMode'),
  targetPrimaryAzoneId?: string(name='TargetPrimaryAzoneId'),
  targetPrimaryRegionId?: string(name='TargetPrimaryRegionId'),
}

model SwitchDBInstanceHAResponseBody = {
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model SwitchDBInstanceHAResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SwitchDBInstanceHAResponseBody(name='body'),
}

/**
 * @param request SwitchDBInstanceHARequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SwitchDBInstanceHAResponse
 */
async function switchDBInstanceHAWithOptions(request: SwitchDBInstanceHARequest, runtime: $RuntimeOptions): SwitchDBInstanceHAResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.DBInstanceName)) {
    query['DBInstanceName'] = request.DBInstanceName;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.switchTime)) {
    query['SwitchTime'] = request.switchTime;
  }
  if (!$isNull(request.switchTimeMode)) {
    query['SwitchTimeMode'] = request.switchTimeMode;
  }
  if (!$isNull(request.targetPrimaryAzoneId)) {
    query['TargetPrimaryAzoneId'] = request.targetPrimaryAzoneId;
  }
  if (!$isNull(request.targetPrimaryRegionId)) {
    query['TargetPrimaryRegionId'] = request.targetPrimaryRegionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'SwitchDBInstanceHA',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request SwitchDBInstanceHARequest
 * @return SwitchDBInstanceHAResponse
 */
async function switchDBInstanceHA(request: SwitchDBInstanceHARequest): SwitchDBInstanceHAResponse {
  var runtime = new $RuntimeOptions{};
  return switchDBInstanceHAWithOptions(request, runtime);
}

model SwitchGdnMemberRoleRequest {
  DBInstanceName?: string(name='DBInstanceName', description='This parameter is required.', example='pxc-********'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  switchMode?: string(name='SwitchMode', description='This parameter is required.'),
  taskTimeout?: long(name='TaskTimeout'),
}

model SwitchGdnMemberRoleResponseBody = {
  data?: {
    taskId?: int32(name='TaskId', example='2209883'),
  }(name='Data'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', description='Id of the request', example='9B2F3840-5C98-475C-B269-2D5C3A31797C'),
  success?: boolean(name='Success', example='true'),
}

model SwitchGdnMemberRoleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SwitchGdnMemberRoleResponseBody(name='body'),
}

/**
 * @summary GDN主备切换
 *
 * @param request SwitchGdnMemberRoleRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SwitchGdnMemberRoleResponse
 */
async function switchGdnMemberRoleWithOptions(request: SwitchGdnMemberRoleRequest, runtime: $RuntimeOptions): SwitchGdnMemberRoleResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.DBInstanceName)) {
    query['DBInstanceName'] = request.DBInstanceName;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.switchMode)) {
    query['SwitchMode'] = request.switchMode;
  }
  if (!$isNull(request.taskTimeout)) {
    query['TaskTimeout'] = request.taskTimeout;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'SwitchGdnMemberRole',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary GDN主备切换
 *
 * @param request SwitchGdnMemberRoleRequest
 * @return SwitchGdnMemberRoleResponse
 */
async function switchGdnMemberRole(request: SwitchGdnMemberRoleRequest): SwitchGdnMemberRoleResponse {
  var runtime = new $RuntimeOptions{};
  return switchGdnMemberRoleWithOptions(request, runtime);
}

model TagResourcesRequest {
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  resourceId?: [ string ](name='ResourceId', description='This parameter is required.'),
  resourceType?: string(name='ResourceType', description='This parameter is required.', example='PolarDBXInstance'),
  tag?: [ 
    {
      key?: string(name='Key', example='12'),
      value?: string(name='Value', example='22'),
    }
  ](name='Tag', description='This parameter is required.'),
}

model TagResourcesResponseBody = {
  requestId?: string(name='RequestId', description='requestId', example='xxxx-xxxx'),
}

model TagResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: TagResourcesResponseBody(name='body'),
}

/**
 * @summary 打标签接口
 *
 * @param request TagResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return TagResourcesResponse
 */
async function tagResourcesWithOptions(request: TagResourcesRequest, runtime: $RuntimeOptions): TagResourcesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!$isNull(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!$isNull(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'TagResources',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 打标签接口
 *
 * @param request TagResourcesRequest
 * @return TagResourcesResponse
 */
async function tagResources(request: TagResourcesRequest): TagResourcesResponse {
  var runtime = new $RuntimeOptions{};
  return tagResourcesWithOptions(request, runtime);
}

model UntagResourcesRequest {
  all?: boolean(name='All'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  resourceId?: [ string ](name='ResourceId', description='This parameter is required.'),
  resourceType?: string(name='ResourceType', description='This parameter is required.', example='PolarDBXInstance'),
  tagKey?: [ string ](name='TagKey'),
}

model UntagResourcesResponseBody = {
  requestId?: string(name='RequestId', description='RequestId', example='xxxxxx'),
}

model UntagResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UntagResourcesResponseBody(name='body'),
}

/**
 * @summary 删标签接口
 *
 * @param request UntagResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UntagResourcesResponse
 */
async function untagResourcesWithOptions(request: UntagResourcesRequest, runtime: $RuntimeOptions): UntagResourcesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.all)) {
    query['All'] = request.all;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!$isNull(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!$isNull(request.tagKey)) {
    query['TagKey'] = request.tagKey;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UntagResources',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 删标签接口
 *
 * @param request UntagResourcesRequest
 * @return UntagResourcesResponse
 */
async function untagResources(request: UntagResourcesRequest): UntagResourcesResponse {
  var runtime = new $RuntimeOptions{};
  return untagResourcesWithOptions(request, runtime);
}

model UpdateBackupPolicyRequest {
  backupPeriod?: string(name='BackupPeriod', example='1001000'),
  backupPlanBegin?: string(name='BackupPlanBegin', example='03:00Z'),
  backupSetRetention?: int32(name='BackupSetRetention', example='30'),
  backupType?: string(name='BackupType', example='0'),
  backupWay?: string(name='BackupWay', example='P'),
  coldDataBackupInterval?: int32(name='ColdDataBackupInterval', example='30'),
  coldDataBackupRetention?: int32(name='ColdDataBackupRetention', example='30'),
  crossRegionDataBackupRetention?: int32(name='CrossRegionDataBackupRetention'),
  crossRegionLogBackupRetention?: int32(name='CrossRegionLogBackupRetention'),
  DBInstanceName?: string(name='DBInstanceName', description='This parameter is required.', example='pxc-hzjasdyuoo'),
  destCrossRegion?: string(name='DestCrossRegion'),
  forceCleanOnHighSpaceUsage?: int32(name='ForceCleanOnHighSpaceUsage', example='1'),
  isCrossRegionDataBackupEnabled?: boolean(name='IsCrossRegionDataBackupEnabled'),
  isCrossRegionLogBackupEnabled?: boolean(name='IsCrossRegionLogBackupEnabled'),
  isEnabled?: int32(name='IsEnabled', example='1'),
  localLogRetention?: int32(name='LocalLogRetention', example='7'),
  localLogRetentionNumber?: int32(name='LocalLogRetentionNumber'),
  logLocalRetentionSpace?: int32(name='LogLocalRetentionSpace', example='30'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  removeLogRetention?: int32(name='RemoveLogRetention', example='7'),
}

model UpdateBackupPolicyResponseBody = {
  data?: {
    backupPeriod?: string(name='BackupPeriod'),
    backupPlanBegin?: string(name='BackupPlanBegin'),
    backupSetRetention?: int32(name='BackupSetRetention'),
    backupType?: string(name='BackupType'),
    backupWay?: string(name='BackupWay'),
    coldDataBackupInterval?: int32(name='ColdDataBackupInterval'),
    coldDataBackupRetention?: int32(name='ColdDataBackupRetention'),
    crossRegionDataBackupRetention?: int32(name='CrossRegionDataBackupRetention'),
    crossRegionLogBackupRetention?: int32(name='CrossRegionLogBackupRetention'),
    DBInstanceName?: string(name='DBInstanceName'),
    destCrossRegion?: string(name='DestCrossRegion'),
    forceCleanOnHighSpaceUsage?: int32(name='ForceCleanOnHighSpaceUsage'),
    isCrossRegionDataBackupEnabled?: boolean(name='IsCrossRegionDataBackupEnabled'),
    isCrossRegionLogBackupEnabled?: boolean(name='IsCrossRegionLogBackupEnabled'),
    isEnabled?: int32(name='IsEnabled'),
    localLogRetention?: int32(name='LocalLogRetention'),
    localLogRetentionNumber?: int32(name='LocalLogRetentionNumber'),
    logLocalRetentionSpace?: int32(name='LogLocalRetentionSpace'),
    removeLogRetention?: int32(name='RemoveLogRetention'),
  }(name='Data'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='FEA5DC20-6D8A-5979-97AA-FC57546ADC20'),
  success?: boolean(name='Success', example='true'),
}

model UpdateBackupPolicyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateBackupPolicyResponseBody(name='body'),
}

/**
 * @param request UpdateBackupPolicyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateBackupPolicyResponse
 */
async function updateBackupPolicyWithOptions(request: UpdateBackupPolicyRequest, runtime: $RuntimeOptions): UpdateBackupPolicyResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.backupPeriod)) {
    query['BackupPeriod'] = request.backupPeriod;
  }
  if (!$isNull(request.backupPlanBegin)) {
    query['BackupPlanBegin'] = request.backupPlanBegin;
  }
  if (!$isNull(request.backupSetRetention)) {
    query['BackupSetRetention'] = request.backupSetRetention;
  }
  if (!$isNull(request.backupType)) {
    query['BackupType'] = request.backupType;
  }
  if (!$isNull(request.backupWay)) {
    query['BackupWay'] = request.backupWay;
  }
  if (!$isNull(request.coldDataBackupInterval)) {
    query['ColdDataBackupInterval'] = request.coldDataBackupInterval;
  }
  if (!$isNull(request.coldDataBackupRetention)) {
    query['ColdDataBackupRetention'] = request.coldDataBackupRetention;
  }
  if (!$isNull(request.crossRegionDataBackupRetention)) {
    query['CrossRegionDataBackupRetention'] = request.crossRegionDataBackupRetention;
  }
  if (!$isNull(request.crossRegionLogBackupRetention)) {
    query['CrossRegionLogBackupRetention'] = request.crossRegionLogBackupRetention;
  }
  if (!$isNull(request.DBInstanceName)) {
    query['DBInstanceName'] = request.DBInstanceName;
  }
  if (!$isNull(request.destCrossRegion)) {
    query['DestCrossRegion'] = request.destCrossRegion;
  }
  if (!$isNull(request.forceCleanOnHighSpaceUsage)) {
    query['ForceCleanOnHighSpaceUsage'] = request.forceCleanOnHighSpaceUsage;
  }
  if (!$isNull(request.isCrossRegionDataBackupEnabled)) {
    query['IsCrossRegionDataBackupEnabled'] = request.isCrossRegionDataBackupEnabled;
  }
  if (!$isNull(request.isCrossRegionLogBackupEnabled)) {
    query['IsCrossRegionLogBackupEnabled'] = request.isCrossRegionLogBackupEnabled;
  }
  if (!$isNull(request.isEnabled)) {
    query['IsEnabled'] = request.isEnabled;
  }
  if (!$isNull(request.localLogRetention)) {
    query['LocalLogRetention'] = request.localLogRetention;
  }
  if (!$isNull(request.localLogRetentionNumber)) {
    query['LocalLogRetentionNumber'] = request.localLogRetentionNumber;
  }
  if (!$isNull(request.logLocalRetentionSpace)) {
    query['LogLocalRetentionSpace'] = request.logLocalRetentionSpace;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.removeLogRetention)) {
    query['RemoveLogRetention'] = request.removeLogRetention;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateBackupPolicy',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request UpdateBackupPolicyRequest
 * @return UpdateBackupPolicyResponse
 */
async function updateBackupPolicy(request: UpdateBackupPolicyRequest): UpdateBackupPolicyResponse {
  var runtime = new $RuntimeOptions{};
  return updateBackupPolicyWithOptions(request, runtime);
}

model UpdateDBInstanceSSLRequest {
  certCommonName?: string(name='CertCommonName', example='pxc-hzrqjarxdocd4t.polarx.rds.aliyuncs.com'),
  DBInstanceName?: string(name='DBInstanceName', description='This parameter is required.', example='pxc-hzjasd****'),
  enableSSL?: boolean(name='EnableSSL', description='This parameter is required.', example='true'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
}

model UpdateDBInstanceSSLResponseBody = {
  data?: {
    taskId?: long(name='TaskId', example='2209883'),
  }(name='Data'),
  requestId?: string(name='RequestId', example='FEA5DC20-6D8A-5979-97AA-FC57546ADC20'),
}

model UpdateDBInstanceSSLResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateDBInstanceSSLResponseBody(name='body'),
}

/**
 * @param request UpdateDBInstanceSSLRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateDBInstanceSSLResponse
 */
async function updateDBInstanceSSLWithOptions(request: UpdateDBInstanceSSLRequest, runtime: $RuntimeOptions): UpdateDBInstanceSSLResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.certCommonName)) {
    query['CertCommonName'] = request.certCommonName;
  }
  if (!$isNull(request.DBInstanceName)) {
    query['DBInstanceName'] = request.DBInstanceName;
  }
  if (!$isNull(request.enableSSL)) {
    query['EnableSSL'] = request.enableSSL;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateDBInstanceSSL',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request UpdateDBInstanceSSLRequest
 * @return UpdateDBInstanceSSLResponse
 */
async function updateDBInstanceSSL(request: UpdateDBInstanceSSLRequest): UpdateDBInstanceSSLResponse {
  var runtime = new $RuntimeOptions{};
  return updateDBInstanceSSLWithOptions(request, runtime);
}

model UpdateDBInstanceTDERequest {
  DBInstanceName?: string(name='DBInstanceName', description='This parameter is required.', example='pxc-hzjasd****'),
  encryptionKey?: string(name='EncryptionKey', example='RkVBNURDMjAtNkQ4QS01OTc5LTk3QUEtRkM1NzU0Nk******'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  roleArn?: string(name='RoleArn', example='acs:ram::1406926****:role/aliyunrdsinstanceencryptiondefaultrole'),
  TDEStatus?: int32(name='TDEStatus', description='This parameter is required.', example='1'),
}

model UpdateDBInstanceTDEResponseBody = {
  data?: {
    taskId?: string(name='TaskId', example='42292****'),
  }(name='Data'),
  requestId?: string(name='RequestId', example='FEA5DC20-6D8A-5979-97AA-FC57546ADC20'),
}

model UpdateDBInstanceTDEResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateDBInstanceTDEResponseBody(name='body'),
}

/**
 * @param request UpdateDBInstanceTDERequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateDBInstanceTDEResponse
 */
async function updateDBInstanceTDEWithOptions(request: UpdateDBInstanceTDERequest, runtime: $RuntimeOptions): UpdateDBInstanceTDEResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.DBInstanceName)) {
    query['DBInstanceName'] = request.DBInstanceName;
  }
  if (!$isNull(request.encryptionKey)) {
    query['EncryptionKey'] = request.encryptionKey;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.roleArn)) {
    query['RoleArn'] = request.roleArn;
  }
  if (!$isNull(request.TDEStatus)) {
    query['TDEStatus'] = request.TDEStatus;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateDBInstanceTDE',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request UpdateDBInstanceTDERequest
 * @return UpdateDBInstanceTDEResponse
 */
async function updateDBInstanceTDE(request: UpdateDBInstanceTDERequest): UpdateDBInstanceTDEResponse {
  var runtime = new $RuntimeOptions{};
  return updateDBInstanceTDEWithOptions(request, runtime);
}

model UpdatePolarDBXInstanceNodeRequest {
  addDNSpec?: string(name='AddDNSpec'),
  CNNodeCount?: int32(name='CNNodeCount', example='2'),
  clientToken?: string(name='ClientToken', example='FEA5DC20-6D8A-5979-97AA-FC57546ADC20'),
  DBInstanceName?: string(name='DBInstanceName', description='This parameter is required.', example='pxc-hzjasdyuoo'),
  DNNodeCount?: int32(name='DNNodeCount', example='2'),
  dbInstanceNodeCount?: int32(name='DbInstanceNodeCount', example='3'),
  deleteDNIds?: string(name='DeleteDNIds'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  storagePoolName?: string(name='StoragePoolName'),
}

model UpdatePolarDBXInstanceNodeResponseBody = {
  orderId?: string(name='OrderId', example='20211103105558'),
  requestId?: string(name='RequestId', example='FEA5DC20-6D8A-5979-97AA-FC57546ADC20'),
}

model UpdatePolarDBXInstanceNodeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdatePolarDBXInstanceNodeResponseBody(name='body'),
}

/**
 * @summary 扩缩容实例节点数
 *
 * @param request UpdatePolarDBXInstanceNodeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdatePolarDBXInstanceNodeResponse
 */
async function updatePolarDBXInstanceNodeWithOptions(request: UpdatePolarDBXInstanceNodeRequest, runtime: $RuntimeOptions): UpdatePolarDBXInstanceNodeResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.addDNSpec)) {
    query['AddDNSpec'] = request.addDNSpec;
  }
  if (!$isNull(request.CNNodeCount)) {
    query['CNNodeCount'] = request.CNNodeCount;
  }
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.DBInstanceName)) {
    query['DBInstanceName'] = request.DBInstanceName;
  }
  if (!$isNull(request.DNNodeCount)) {
    query['DNNodeCount'] = request.DNNodeCount;
  }
  if (!$isNull(request.dbInstanceNodeCount)) {
    query['DbInstanceNodeCount'] = request.dbInstanceNodeCount;
  }
  if (!$isNull(request.deleteDNIds)) {
    query['DeleteDNIds'] = request.deleteDNIds;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.storagePoolName)) {
    query['StoragePoolName'] = request.storagePoolName;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdatePolarDBXInstanceNode',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 扩缩容实例节点数
 *
 * @param request UpdatePolarDBXInstanceNodeRequest
 * @return UpdatePolarDBXInstanceNodeResponse
 */
async function updatePolarDBXInstanceNode(request: UpdatePolarDBXInstanceNodeRequest): UpdatePolarDBXInstanceNodeResponse {
  var runtime = new $RuntimeOptions{};
  return updatePolarDBXInstanceNodeWithOptions(request, runtime);
}

model UpgradeDBInstanceKernelVersionRequest {
  DBInstanceName?: string(name='DBInstanceName', description='This parameter is required.', example='pxc-hzjasd****'),
  minorVersion?: string(name='MinorVersion', example='polarx-kernel_5.4.12-16349923_xcluster-20210926'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  switchMode?: string(name='SwitchMode', example='0'),
}

model UpgradeDBInstanceKernelVersionResponseBody = {
  DBInstanceName?: string(name='DBInstanceName', example='pxc-hzjasd****'),
  requestId?: string(name='RequestId', example='FEA5DC20-6D8A-5979-97AA-FC57546ADC20'),
  targetMinorVersion?: string(name='TargetMinorVersion', example='polarx-kernel_5.4.7-16001481_xcluster-20200910'),
  taskId?: string(name='TaskId', example='422922413'),
}

model UpgradeDBInstanceKernelVersionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpgradeDBInstanceKernelVersionResponseBody(name='body'),
}

/**
 * @param request UpgradeDBInstanceKernelVersionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpgradeDBInstanceKernelVersionResponse
 */
async function upgradeDBInstanceKernelVersionWithOptions(request: UpgradeDBInstanceKernelVersionRequest, runtime: $RuntimeOptions): UpgradeDBInstanceKernelVersionResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.DBInstanceName)) {
    query['DBInstanceName'] = request.DBInstanceName;
  }
  if (!$isNull(request.minorVersion)) {
    query['MinorVersion'] = request.minorVersion;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.switchMode)) {
    query['SwitchMode'] = request.switchMode;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpgradeDBInstanceKernelVersion',
    version = '2020-02-02',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request UpgradeDBInstanceKernelVersionRequest
 * @return UpgradeDBInstanceKernelVersionResponse
 */
async function upgradeDBInstanceKernelVersion(request: UpgradeDBInstanceKernelVersionRequest): UpgradeDBInstanceKernelVersionResponse {
  var runtime = new $RuntimeOptions{};
  return upgradeDBInstanceKernelVersionWithOptions(request, runtime);
}

